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:
authorCampbell Barton <ideasman42@gmail.com>2019-04-30 08:03:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-30 08:04:07 +0300
commit546e20f5a2c090da9328e44af2c9d5b6d4cb1fb9 (patch)
treeaa3e96ddf7e0ef599f2e71a3d2d97c49624cfba1 /release
parente83d4d963766487919edb8858de0020ef2c3cfe8 (diff)
UI: show transform options in image header when topbar is hidden
Matches 3D view behavior.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_image.py54
1 files changed, 32 insertions, 22 deletions
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: