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-16 03:39:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-16 03:39:31 +0300
commitd4ffccbeae90e9a41e74e4a720e2f623e1fa0c2e (patch)
tree7287896851f296b4707cf83c4b3195971d962078 /release/scripts/startup/bl_ui
parent3adb9530bb561b9cbb74e4efd450b79bd937fda9 (diff)
parentfef7b792e7637b4dcdc4b67629c523782c47beb4 (diff)
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py75
1 files changed, 46 insertions, 29 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index d9661322821..2700a29f908 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -444,31 +444,40 @@ class _defs_view3d_add:
# Layout tweaks here would be good to avoid,
# this shows limits in layout engine, as buttons are using a lot of space.
@staticmethod
- def draw_settings_interactive_add(layout, tool):
+ def draw_settings_interactive_add(layout, tool, extra):
props = tool.operator_properties("view3d.interactive_add")
- row = layout.row()
- row.scale_x = 0.8
- row.label(text="Depth:")
- row = layout.row()
- row.scale_x = 0.9
- row.prop(props, "plane_depth", text="")
- row = layout.row()
- row.prop(props, "plane_axis", text="")
- row = layout.row()
- row.scale_x = 0.8
- row.label(text="Orientation:")
- row = layout.row()
- row.prop(props, "plane_orientation", text="")
- row = layout.row()
- row.scale_x = 0.7
- row.prop(props, "plane_origin")
- row.scale_x = 0.8
- row.prop(props, "snap_target")
+ if not extra:
+ row = layout.row()
+ row.scale_x = 0.8
+ row.label(text="Depth:")
+ row = layout.row()
+ row.scale_x = 0.9
+ row.prop(props, "plane_depth", text="")
+ row = layout.row()
+ row.scale_x = 0.8
+ row.label(text="Orientation:")
+ row = layout.row()
+ row.prop(props, "plane_orientation", text="")
+ row = layout.row()
+ row.scale_x = 0.8
+ row.prop(props, "snap_target")
+
+ region_is_header = bpy.context.region.type == 'TOOL_HEADER'
+
+ if region_is_header:
+ layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
+ else:
+ extra = True
+
+ if extra:
+ layout.use_property_split = True
+ layout.row().prop(props, "plane_axis", expand=True)
+ layout.row().prop(props, "plane_origin", expand=True)
@ToolDef.from_fn
def cube_add():
- def draw_settings(_context, layout, tool):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool)
+ def draw_settings(_context, layout, tool, *, extra=False):
+ _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
return dict(
idname="builtin.primitive_cube_add",
label="Add Cube",
@@ -483,8 +492,10 @@ class _defs_view3d_add:
@ToolDef.from_fn
def cone_add():
- def draw_settings(_context, layout, tool):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool)
+ def draw_settings(_context, layout, tool, *, extra=False):
+ _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")
@@ -503,8 +514,10 @@ class _defs_view3d_add:
@ToolDef.from_fn
def cylinder_add():
- def draw_settings(_context, layout, tool):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool)
+ def draw_settings(_context, layout, tool, *, extra=False):
+ _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")
@@ -523,8 +536,10 @@ class _defs_view3d_add:
@ToolDef.from_fn
def uv_sphere_add():
- def draw_settings(_context, layout, tool):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool)
+ def draw_settings(_context, layout, tool, *, extra=False):
+ _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")
@@ -543,8 +558,10 @@ class _defs_view3d_add:
@ToolDef.from_fn
def ico_sphere_add():
- def draw_settings(_context, layout, tool):
- _defs_view3d_add.draw_settings_interactive_add(layout, tool)
+ def draw_settings(_context, layout, tool, *, extra=False):
+ _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")