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>2021-01-17 13:33:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-17 13:36:49 +0300
commit2ee2f87f29bb35642f0eb0a195f267608cca0196 (patch)
tree280393ee8798cb676e69347616d3a7512c88647e /release
parent06da6e2eaf76d475ea0743960b308d6c034eb8bf (diff)
Add Object Tool: move extra settings popover last
This is intended to be used when settings don't fit in the top bar, so it makes sense to keep them last.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py32
1 files changed, 25 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 1b2303b6e7d..ba165d1e86c 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -474,6 +474,7 @@ class _defs_view3d_add:
# this shows limits in layout engine, as buttons are using a lot of space.
@staticmethod
def draw_settings_interactive_add(layout, tool, extra):
+ show_extra = False
props = tool.operator_properties("view3d.interactive_add")
if not extra:
row = layout.row()
@@ -494,7 +495,8 @@ class _defs_view3d_add:
region_is_header = bpy.context.region.type == 'TOOL_HEADER'
if region_is_header:
- layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
+ # Don't draw the "extra" popover here as we might have other settings & this should be last.
+ show_extra = True
else:
extra = True
@@ -508,12 +510,15 @@ class _defs_view3d_add:
layout.label(text="Height")
layout.row().prop(props, "plane_origin_depth", expand=True)
layout.row().prop(props, "plane_aspect_depth", expand=True)
-
+ return show_extra
@ToolDef.from_fn
def cube_add():
def draw_settings(_context, layout, tool, *, extra=False):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
+ show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
+ if show_extra:
+ layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
+
return dict(
idname="builtin.primitive_cube_add",
label="Add Cube",
@@ -529,13 +534,17 @@ class _defs_view3d_add:
@ToolDef.from_fn
def cone_add():
def draw_settings(_context, layout, tool, *, extra=False):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
+ show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_cone_add")
layout.prop(props, "vertices")
layout.prop(props, "end_fill_type")
+
+ if show_extra:
+ layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
+
return dict(
idname="builtin.primitive_cone_add",
label="Add Cone",
@@ -551,13 +560,16 @@ class _defs_view3d_add:
@ToolDef.from_fn
def cylinder_add():
def draw_settings(_context, layout, tool, *, extra=False):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
+ show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_cylinder_add")
layout.prop(props, "vertices")
layout.prop(props, "end_fill_type")
+
+ if show_extra:
+ layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_cylinder_add",
label="Add Cylinder",
@@ -573,13 +585,16 @@ class _defs_view3d_add:
@ToolDef.from_fn
def uv_sphere_add():
def draw_settings(_context, layout, tool, *, extra=False):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
+ show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_uv_sphere_add")
layout.prop(props, "segments")
layout.prop(props, "ring_count")
+
+ if show_extra:
+ layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_uv_sphere_add",
label="Add UV Sphere",
@@ -595,12 +610,15 @@ class _defs_view3d_add:
@ToolDef.from_fn
def ico_sphere_add():
def draw_settings(_context, layout, tool, *, extra=False):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
+ show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_ico_sphere_add")
layout.prop(props, "subdivisions")
+
+ if show_extra:
+ layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_ico_sphere_add",
label="Add Ico Sphere",