[Bf-blender-cvs] [ae90dc19e7a] blender2.8: View3D Header: Display the text "Mix" instead of an icon when more than one snap element is enabled.
mano-wii
noreply at git.blender.org
Wed Oct 10 01:12:07 CEST 2018
Commit: ae90dc19e7af46405f6cbb6a632e6a6bc0eda088
Author: mano-wii
Date: Tue Oct 9 20:10:52 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBae90dc19e7af46405f6cbb6a632e6a6bc0eda088
View3D Header: Display the text "Mix" instead of an icon when more than one snap element is enabled.
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 1bce3992f07..b4146a59ff6 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -151,12 +151,12 @@ class VIEW3D_HT_header(Header):
if show_snap:
snap_items = bpy.types.ToolSettings.bl_rna.properties['snap_elements'].enum_items
- for elem in tool_settings.snap_elements:
- # TODO: Display multiple icons.
- # (Currently only one of the enabled modes icons is displayed)
- icon = snap_items[elem].icon
- break
+ if len(tool_settings.snap_elements) == 1:
+ text = ""
+ for elem in tool_settings.snap_elements:
+ icon = snap_items[elem].icon
else:
+ text = "Mix"
icon = 'NONE'
row = layout.row(align=True)
@@ -166,7 +166,7 @@ class VIEW3D_HT_header(Header):
sub.popover(
panel="VIEW3D_PT_snapping",
icon=icon,
- text="",
+ text=text,
)
# Proportional editing
More information about the Bf-blender-cvs
mailing list