[Bf-blender-cvs] [12c664f7fb5] blender2.8: GP: Adjust topbar layer selector to new fixed width

Antonioya noreply at git.blender.org
Wed Sep 26 10:49:52 CEST 2018


Commit: 12c664f7fb51bd4ff6db82223dbb5f932c2d3888
Author: Antonioya
Date:   Wed Sep 26 10:49:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB12c664f7fb51bd4ff6db82223dbb5f932c2d3888

GP: Adjust topbar layer selector to new fixed width

===================================================================

M	release/scripts/startup/bl_ui/space_topbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index b786201b5b3..36cd2093bef 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -158,8 +158,9 @@ class TOPBAR_HT_lower_bar(Header):
         gpl = context.active_gpencil_layer
         if gpl and gpl.info is not None:
             txt = gpl.info
-            if len(txt) > 10:
-                txt = txt[:7] + '..' + txt[-2:]
+            maxw = 25
+            if len(txt) > maxw:
+                txt = txt[:maxw - 5] + '..' + txt[-3:]
         else:
             txt = ""
 
@@ -191,7 +192,9 @@ class TOPBAR_HT_lower_bar(Header):
             layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".objectmode", category="")
         elif mode == 'GPENCIL_PAINT':
             layout.label(text="Layer:")
-            layout.popover(
+            sub = layout.row()
+            sub.ui_units_x = 8
+            sub.popover(
                 panel="TOPBAR_PT_gpencil_layers",
                 text=txt,
             )
@@ -201,7 +204,9 @@ class TOPBAR_HT_lower_bar(Header):
             layout.prop(context.tool_settings, "use_gpencil_additive_drawing", text="", icon='FREEZE')
         elif mode in {'GPENCIL_EDIT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}:
             layout.label(text="Layer:")
-            layout.popover(
+            sub = layout.row()
+            sub.ui_units_x = 8
+            sub.popover(
                 panel="TOPBAR_PT_gpencil_layers",
                 text=txt,
             )



More information about the Bf-blender-cvs mailing list