diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-30 01:55:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-30 02:00:39 +0300 |
commit | add923f98a75f11200056c83d7f766304bb6b29b (patch) | |
tree | 1dff069a9ea796cd48615ce7b6dbaf0ccd4113be /release/scripts/startup/bl_ui/space_toolsystem_common.py | |
parent | 6fa7fa6671c9e7cf9baad54b0f0861755b43f2b1 (diff) |
UI: add active tool panel to tool settings
Diffstat (limited to 'release/scripts/startup/bl_ui/space_toolsystem_common.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_common.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index e03b3eb585d..b8e3d81c1d4 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -513,16 +513,21 @@ class ToolSelectPanelHelper: self.draw_cls(self.layout, context) @staticmethod - def draw_active_tool_header(context, layout): + def draw_active_tool_header( + context, layout, + *, + show_tool_name=False, + ): # BAD DESIGN WARNING: last used tool workspace = context.workspace space_type = workspace.tools_space_type mode = workspace.tools_mode item, tool, icon_value = ToolSelectPanelHelper._tool_get_active(context, space_type, mode, with_icon=True) if item is None: - return - # Note: we could show 'item.text' here but it makes the layout jitter when switcuing tools. - layout.label(text=" ", icon_value=icon_value) + return None + # Note: we could show 'item.text' here but it makes the layout jitter when switching tools. + # Add some spacing since the icon is currently assuming regular small icon size. + layout.label(text=" " + item.text if show_tool_name else " ", icon_value=icon_value) draw_settings = item.draw_settings if draw_settings is not None: draw_settings(context, layout, tool) |