[Bf-blender-cvs] [546e20f5a2c] master: UI: show transform options in image header when topbar is hidden

Campbell Barton noreply at git.blender.org
Tue Apr 30 07:05:10 CEST 2019


Commit: 546e20f5a2c090da9328e44af2c9d5b6d4cb1fb9
Author: Campbell Barton
Date:   Tue Apr 30 15:03:07 2019 +1000
Branches: master
https://developer.blender.org/rB546e20f5a2c090da9328e44af2c9d5b6d4cb1fb9

UI: show transform options in image header when topbar is hidden

Matches 3D view behavior.

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

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

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

diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 8bffeedc25d..ef87caec8d7 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -504,30 +504,10 @@ class IMAGE_HT_tool_header(Header):
         self.draw_tool_settings(context)
 
         sima = context.space_data
-        show_uvedit = sima.show_uvedit
-        show_maskedit = sima.show_maskedit
 
         layout.separator_spacer()
 
-        if show_uvedit or show_maskedit:
-            layout.prop(sima, "pivot_point", icon_only=True)
-
-        if show_uvedit:
-            tool_settings = context.tool_settings
-
-            # Snap.
-            row = layout.row(align=True)
-            row.prop(tool_settings, "use_snap", text="")
-            row.prop(tool_settings, "snap_uv_element", icon_only=True)
-            if tool_settings.snap_uv_element != 'INCREMENT':
-                row.prop(tool_settings, "snap_target", text="")
-
-            # Proportional Editing
-            row = layout.row(align=True)
-            row.prop(tool_settings, "use_proportional_edit", icon_only=True)
-            sub = row.row(align=True)
-            sub.active = tool_settings.use_proportional_edit
-            sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
+        IMAGE_HT_header.draw_xform_template(layout, context)
 
         layout.separator_spacer()
 
@@ -616,6 +596,32 @@ class _draw_tool_settings_context_mode:
 class IMAGE_HT_header(Header):
     bl_space_type = 'IMAGE_EDITOR'
 
+    @staticmethod
+    def draw_xform_template(layout, context):
+        sima = context.space_data
+        show_uvedit = sima.show_uvedit
+        show_maskedit = sima.show_maskedit
+
+        if show_uvedit or show_maskedit:
+            layout.prop(sima, "pivot_point", icon_only=True)
+
+        if show_uvedit:
+            tool_settings = context.tool_settings
+
+            # Snap.
+            row = layout.row(align=True)
+            row.prop(tool_settings, "use_snap", text="")
+            row.prop(tool_settings, "snap_uv_element", icon_only=True)
+            if tool_settings.snap_uv_element != 'INCREMENT':
+                row.prop(tool_settings, "snap_target", text="")
+
+            # Proportional Editing
+            row = layout.row(align=True)
+            row.prop(tool_settings, "use_proportional_edit", icon_only=True)
+            sub = row.row(align=True)
+            sub.active = tool_settings.use_proportional_edit
+            sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
+
     def draw(self, context):
         layout = self.layout
 
@@ -623,12 +629,13 @@ class IMAGE_HT_header(Header):
         ima = sima.image
         iuser = sima.image_user
         tool_settings = context.tool_settings
+        show_region_tool_header = sima.show_region_tool_header
 
         show_render = sima.show_render
         show_uvedit = sima.show_uvedit
         show_maskedit = sima.show_maskedit
 
-        if not sima.show_region_tool_header:
+        if not show_region_tool_header:
             layout.template_header()
 
         if sima.mode != 'UV':
@@ -650,6 +657,9 @@ class IMAGE_HT_header(Header):
 
         layout.separator_spacer()
 
+        if not show_region_tool_header:
+            IMAGE_HT_header.draw_xform_template(layout, context)
+
         layout.template_ID(sima, "image", new="image.new", open="image.open")
 
         if show_maskedit:



More information about the Bf-blender-cvs mailing list