UI: tweak object viewport display panel, use grid flow.
authorWilliam Reynish <billreynish>
Mon, 3 Sep 2018 17:33:23 +0000 (19:33 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 3 Sep 2018 17:35:25 +0000 (19:35 +0200)
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_object.py

index 8ea20ada3905f23ea904b4fba92bf4e3281980cb..d29b2d88d985effaae564cc785123b352f54c6eb 100644 (file)
@@ -85,7 +85,7 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
         col.prop(arm, "show_bone_custom_shapes", text="Shapes")
         col.prop(arm, "show_group_colors", text="Group Colors")
         if ob:
-            col.prop(ob, "show_x_ray", text="X-Ray")
+            col.prop(ob, "show_x_ray", text="In Front")
         col.prop(arm, "use_deform_delay", text="Delay Refresh")
 
 
index 79b2f7b8df8b590985c6abb1d152942527813023..17b4876c7f3dfbb261178fdbfea8890472b20d10 100644 (file)
@@ -222,6 +222,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
+
         flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
 
         obj = context.object
@@ -231,44 +232,51 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
         is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE')
         is_dupli = (obj.dupli_type != 'NONE')
 
-        col = flow.column(align=True)
+        col = flow.column()
         col.prop(obj, "show_name", text="Name")
+
+        col = flow.column()
         col.prop(obj, "show_axis", text="Axis")
 
         # Makes no sense for cameras, armatures, etc.!
         # but these settings do apply to dupli instances
-        col = flow.column(align=True)
         if is_geometry or is_dupli:
+            col = flow.column()
             col.prop(obj, "show_wire", text="Wireframe")
         if obj_type == 'MESH' or is_dupli:
-            col.prop(obj, "show_all_edges")
-
-        col = flow.column()
-        col.prop(obj, "show_bounds", text="Bounds")
-        sub = col.column()
-        sub.active = obj.show_bounds
-        sub.prop(obj, "draw_bounds_type")
+            col = flow.column()
+            col.prop(obj, "show_all_edges", text="All Edges")
 
         col = flow.column()
         if is_geometry:
             col.prop(obj, "show_texture_space", text="Texture Space")
+            col = flow.column()
             col.prop(obj.display, "show_shadows", text="Shadow")
 
-        col.prop(obj, "show_x_ray", text="X-Ray")
+        col = flow.column()
+        col.prop(obj, "show_x_ray", text="In Front")
         # if obj_type == 'MESH' or is_empty_image:
         #    col.prop(obj, "show_transparent", text="Transparency")
 
+
+        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+
         col = flow.column()
         if is_wire:
             # wire objects only use the max. draw type for duplis
             col.active = is_dupli
-        col.prop(
-            obj, "draw_type",
-            text="Maximum Draw Type" if is_wire else "Maximum Draw Type",
-        )
+        col.prop(obj, "draw_type", text="Display As")
+
+        split = flow.split(factor=0.6)
+        split.prop(obj, "show_bounds", text="Bounds")
+        row = split.row()
+        row.active = obj.show_bounds or (obj.draw_type == 'BOUNDS')
+        row.prop(obj, "draw_bounds_type", text="")
+
 
         if is_geometry or is_empty_image:
             # Only useful with object having faces/materials...
+            col = flow.column()
             col.prop(obj, "color")