diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-06 09:31:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-06 09:32:25 +0300 |
commit | 1889eec918196527aaa7deb3064129e448568d06 (patch) | |
tree | d150568d1529d8abac587a104252c5b85f9c276d /release/scripts/startup | |
parent | c1a880bc5e919da044f6c9599cec4653f88c29d9 (diff) |
UI: use regular size icons for toolbar popup
Test this since the popup feels disruptive/flashing when its too large
when set smaller it looks closer to a menu w/ key-accelerators which is
the intention in this case.
It's also more likely the active tool can be placed under the cursor.
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_common.py | 21 |
2 files changed, 10 insertions, 13 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index ee101bb3cc6..e62a1f071a9 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2394,7 +2394,7 @@ class WM_OT_toolbar(Operator): def draw_menu(popover, context): layout = popover.layout - cls.draw_cls(layout, context, detect_layout=False) + cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0) wm.popover(draw_menu, keymap=keymap) return {'FINISHED'} diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index a909dad1ff3..2b9d4207272 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -339,9 +339,7 @@ class ToolSelectPanelHelper: # - None: Signal to finish (complete any final operations, e.g. add padding). @staticmethod - def _layout_generator_single_column(layout): - scale_y = 2.0 - + def _layout_generator_single_column(layout, scale_y): col = layout.column(align=True) col.scale_y = scale_y is_sep = False @@ -355,9 +353,8 @@ class ToolSelectPanelHelper: is_sep = yield col @staticmethod - def _layout_generator_multi_columns(layout, column_count): - scale_y = 2.0 - scale_x = 2.2 + def _layout_generator_multi_columns(layout, column_count, scale_y): + scale_x = scale_y * 1.1 column_last = column_count - 1 col = layout.column(align=True) @@ -394,7 +391,7 @@ class ToolSelectPanelHelper: column_index += 1 @staticmethod - def _layout_generator_detect_from_region(layout, region): + def _layout_generator_detect_from_region(layout, region, scale_y): """ Choose an appropriate layout for the toolbar. """ @@ -421,14 +418,14 @@ class ToolSelectPanelHelper: column_count = 1 if column_count == 1: - ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout) + ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout, scale_y=scale_y) else: - ui_gen = ToolSelectPanelHelper._layout_generator_multi_columns(layout, column_count=column_count) + ui_gen = ToolSelectPanelHelper._layout_generator_multi_columns(layout, column_count=column_count, scale_y=scale_y) return ui_gen, show_text @classmethod - def draw_cls(cls, layout, context, detect_layout=True): + def draw_cls(cls, layout, context, detect_layout=True, scale_y=2.0): # Use a classmethod so it can be called outside of a panel context. # XXX, this UI isn't very nice. @@ -444,9 +441,9 @@ class ToolSelectPanelHelper: ) if detect_layout: - ui_gen, show_text = cls._layout_generator_detect_from_region(layout, context.region) + ui_gen, show_text = cls._layout_generator_detect_from_region(layout, context.region, scale_y) else: - ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout) + ui_gen = ToolSelectPanelHelper._layout_generator_single_column(layout, scale_y) show_text = True # Start iteration |