[Bf-blender-cvs] [fc4d2d1e16e] temp-checkbox-layout-tweaks: Use checkbox+value in split layout for object bounds type

Julian Eisel noreply at git.blender.org
Fri Apr 10 02:02:04 CEST 2020


Commit: fc4d2d1e16ec6f02cd29e2c063539d16eefe6078
Author: Julian Eisel
Date:   Fri Apr 10 01:50:15 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rBfc4d2d1e16ec6f02cd29e2c063539d16eefe6078

Use checkbox+value in split layout for object bounds type

See previous commit.
Meant as an example for how this can be done in .py.

===================================================================

M	release/scripts/startup/bl_ui/properties_object.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index c1fe882c8d2..098dc8c61e3 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -246,25 +246,15 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
             # Only useful with object having faces/materials...
             col.prop(obj, "color")
 
-
-class OBJECT_PT_display_bounds(ObjectButtonsPanel, Panel):
-    bl_label = "Bounds"
-    bl_parent_id = "OBJECT_PT_display"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw_header(self, context):
-
-        obj = context.object
-
-        self.layout.prop(obj, "show_bounds", text="")
-
-    def draw(self, context):
-        layout = self.layout
-        obj = context.object
-        layout.use_property_split = True
-
-        layout.active = obj.show_bounds or (obj.display_type == 'BOUNDS')
-        layout.prop(obj, "display_bounds_type", text="Shape")
+        col = layout.column(align=False, heading="Bounds")
+        col.use_property_decorate = False
+        row = col.row(align=True)
+        sub = row.row(align=True)
+        sub.prop(obj, "show_bounds", text="")
+        sub = sub.row(align=True)
+        sub.active = obj.show_bounds or (obj.display_type == 'BOUNDS')
+        sub.prop(obj, "display_bounds_type", text="")
+        row.prop_decorator(obj, "display_bounds_type")
 
 
 class OBJECT_PT_instancing(ObjectButtonsPanel, Panel):
@@ -401,7 +391,6 @@ classes = (
     OBJECT_PT_motion_paths,
     OBJECT_PT_motion_paths_display,
     OBJECT_PT_display,
-    OBJECT_PT_display_bounds,
     OBJECT_PT_visibility,
     OBJECT_PT_custom_props,
 )



More information about the Bf-blender-cvs mailing list