diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-02 18:34:44 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-02 18:34:44 +0300 |
commit | a8cf9d2f805275d2550aead4e5fe36049f79add9 (patch) | |
tree | 1d5d0b1f9aa76c00e854e006d4356714bd76352a /release/scripts/startup/bl_operators | |
parent | 4330f147d0bf0f5f38f0cf05e05de717d95b437f (diff) |
UI: Use property split layout for add torus operator
Continuing the work from D8326, this commit adds a property split
layout to the add torus operator. It also puts the properties common
to all object add operators at the bottom for consistency.
Differential Revision: https://developer.blender.org/D8748
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r-- | release/scripts/startup/bl_operators/add_mesh_torus.py | 53 |
1 files changed, 18 insertions, 35 deletions
diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py index edcd52c12bd..c2f9a4189cf 100644 --- a/release/scripts/startup/bl_operators/add_mesh_torus.py +++ b/release/scripts/startup/bl_operators/add_mesh_torus.py @@ -149,7 +149,7 @@ class AddTorus(Operator, object_utils.AddObjectHelper): default=12, ) mode: EnumProperty( - name="Torus Dimensions", + name="Dimensions Mode", items=( ('MAJOR_MINOR', "Major/Minor", "Use the major/minor radii for torus dimensions"), @@ -204,47 +204,30 @@ class AddTorus(Operator, object_utils.AddObjectHelper): def draw(self, _context): layout = self.layout - col = layout.column(align=True) - col.prop(self, "generate_uvs") - col.separator() - col.prop(self, "align") + layout.use_property_split = True + layout.use_property_decorate = False - col = layout.column(align=True) - col.label(text="Location") - col.prop(self, "location", text="") + layout.separator() - col = layout.column(align=True) - col.label(text="Rotation") - col.prop(self, "rotation", text="") + layout.prop(self, "major_segments") + layout.prop(self, "minor_segments") - col = layout.column(align=True) - col.label(text="Major Segments") - col.prop(self, "major_segments", text="") - - col = layout.column(align=True) - col.label(text="Minor Segments") - col.prop(self, "minor_segments", text="") - - col = layout.column(align=True) - col.label(text="Torus Dimensions") - col.row().prop(self, "mode", expand=True) + layout.separator() + layout.prop(self, "mode") if self.mode == 'MAJOR_MINOR': - col = layout.column(align=True) - col.label(text="Major Radius") - col.prop(self, "major_radius", text="") - - col = layout.column(align=True) - col.label(text="Minor Radius") - col.prop(self, "minor_radius", text="") + layout.prop(self, "major_radius") + layout.prop(self, "minor_radius") else: - col = layout.column(align=True) - col.label(text="Exterior Radius") - col.prop(self, "abso_major_rad", text="") + layout.prop(self, "abso_major_rad") + layout.prop(self, "abso_minor_rad") + + layout.separator() - col = layout.column(align=True) - col.label(text="Interior Radius") - col.prop(self, "abso_minor_rad", text="") + layout.prop(self, "generate_uvs") + layout.prop(self, "align") + layout.prop(self, "location") + layout.prop(self, "rotation") def invoke(self, context, _event): object_utils.object_add_grid_scale_apply_operator(self, context) |