Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dalai@blender.org>2021-10-20 17:19:49 +0300
committerDalai Felinto <dalai@blender.org>2021-10-21 13:12:05 +0300
commit84bb6d7c02d1fd56f454d4470fabad2f11b73808 (patch)
treef0cf81ea86530f30ad9780918b4cadd9aba24c58 /release/scripts
parente79e86018e3879b1587df58ee58fabbce844084f (diff)
UI: Header / Tool Settings: Show tool icon when tools are collapsed
Show the scaled down tool icon when the tool region is collapsed. Show a blank space when the tool region is visible. * Minimize the UI flickering when changing the active tool. * Show the active tool when the tool region is collapsed. * Smaler header footprint (the tool name is not visible). This is a follow up for T91536. Differential Revision: https://developer.blender.org/D12939
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_common.py12
1 files changed, 8 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 4a598d0aa63..4305476cb0f 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -190,7 +190,7 @@ class ToolActivePanelHelper:
ToolSelectPanelHelper.draw_active_tool_header(
context,
layout.column(),
- show_tool_icon=True,
+ show_tool_icon_always=True,
tool_key=ToolSelectPanelHelper._tool_key_from_context(context, space_type=self.bl_space_type),
)
@@ -766,7 +766,7 @@ class ToolSelectPanelHelper:
def draw_active_tool_header(
context, layout,
*,
- show_tool_icon=False,
+ show_tool_icon_always=False,
tool_key=None,
):
if tool_key is None:
@@ -783,11 +783,15 @@ class ToolSelectPanelHelper:
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.
- if show_tool_icon:
+ if show_tool_icon_always:
layout.label(text=" " + item.label, icon_value=icon_value)
layout.separator()
else:
- layout.label(text=item.label)
+ if context.space_data.show_region_toolbar:
+ layout.template_icon(icon_value=0, scale=0.5)
+ else:
+ layout.template_icon(icon_value=icon_value, scale=0.5)
+ layout.separator()
draw_settings = item.draw_settings
if draw_settings is not None: