[Bf-blender-cvs] [b4ba27f0262] master: UI: A few small fixes for constraint layouts

Hans Goudey noreply at git.blender.org
Sun Jun 21 03:51:40 CEST 2020


Commit: b4ba27f02621679853e9511ddbb9cfbdd60e1de8
Author: Hans Goudey
Date:   Sat Jun 20 21:51:32 2020 -0400
Branches: master
https://developer.blender.org/rBb4ba27f02621679853e9511ddbb9cfbdd60e1de8

UI: A few small fixes for constraint layouts

      - Head / Tail was stuck on two rows. It seems there is an issue with
        headings here, which means the first property has to place its own
        label. (So for example the small button can't be first in the row.)
      - Some misalignment and decorator fixes for aligned toggles

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py
index 91c0b5a9b41..cbca5d9ea67 100644
--- a/release/scripts/startup/bl_ui/properties_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_constraint.py
@@ -103,11 +103,13 @@ class ConstraintButtonsPanel(Panel):
                 col.prop_search(con, "subtarget", con.target.data, "bones", text="Bone")
 
                 if hasattr(con, "head_tail"):
-                    row = col.row(align=True, heading="Head/Tail")
+                    row = col.row(align=True)
                     row.use_property_decorate = False
-                    row.prop(con, "head_tail", text="")
+                    sub = row.row(align=True)
+                    sub.prop(con, "head_tail")
                     # XXX icon, and only when bone has segments?
-                    row.prop(con, "use_bbone_shape", text="", icon='IPO_BEZIER')
+                    sub.prop(con, "use_bbone_shape", text="", icon='IPO_BEZIER')
+                    row.prop_decorator(con, "head_tail")
             elif con.target.type in {'MESH', 'LATTICE'}:
                 col.prop_search(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
 
@@ -392,18 +394,20 @@ class ConstraintButtonsPanel(Panel):
 
         layout.prop(con, "euler_order", text="Order")
 
-        row = layout.row(heading="Axis")
+        row = layout.row(heading="Axis", align=True)
         row.use_property_decorate = False
-        row.prop(con, "use_x", text="X", toggle=True)
-        row.prop(con, "use_y", text="Y", toggle=True)
-        row.prop(con, "use_z", text="Z", toggle=True)
+        sub = row.row(align=True)
+        sub.prop(con, "use_x", text="X", toggle=True)
+        sub.prop(con, "use_y", text="Y", toggle=True)
+        sub.prop(con, "use_z", text="Z", toggle=True)
         row.label(icon='BLANK1')
 
-        row = layout.row(heading="Invert")
+        row = layout.row(heading="Invert", align=True)
         row.use_property_decorate = False
-        row.prop(con, "invert_x", text="X", toggle=True)
-        row.prop(con, "invert_y", text="Y", toggle=True)
-        row.prop(con, "invert_z", text="Z", toggle=True)
+        sub = row.row(align=True)
+        sub.prop(con, "invert_x", text="X", toggle=True)
+        sub.prop(con, "invert_y", text="Y", toggle=True)
+        sub.prop(con, "invert_z", text="Z", toggle=True)
         row.label(icon='BLANK1')
 
         layout.prop(con, "mix_mode", text="Mix")
@@ -420,18 +424,20 @@ class ConstraintButtonsPanel(Panel):
 
         self.target_template(layout, con)
 
-        row = layout.row(heading="Axis")
+        row = layout.row(heading="Axis", align=True)
         row.use_property_decorate = False
-        row.prop(con, "use_x", text="X", toggle=True)
-        row.prop(con, "use_y", text="Y", toggle=True)
-        row.prop(con, "use_z", text="Z", toggle=True)
+        sub = row.row(align=True)
+        sub.prop(con, "use_x", text="X", toggle=True)
+        sub.prop(con, "use_y", text="Y", toggle=True)
+        sub.prop(con, "use_z", text="Z", toggle=True)
         row.label(icon='BLANK1')
 
-        row = layout.row(heading="Invert")
+        row = layout.row(heading="Invert", align=True)
         row.use_property_decorate = False
-        row.prop(con, "invert_x", text="X", toggle=True)
-        row.prop(con, "invert_y", text="Y", toggle=True)
-        row.prop(con, "invert_z", text="Z", toggle=True)
+        sub = row.row(align=True)
+        sub.prop(con, "invert_x", text="X", toggle=True)
+        sub.prop(con, "invert_y", text="Y", toggle=True)
+        sub.prop(con, "invert_z", text="Z", toggle=True)
         row.label(icon='BLANK1')
 
         layout.prop(con, "use_offset")
@@ -448,10 +454,13 @@ class ConstraintButtonsPanel(Panel):
 
         self.target_template(layout, con)
 
-        row = layout.row(heading="Axis")
-        row.prop(con, "use_x", text="X", toggle=True)
-        row.prop(con, "use_y", text="Y", toggle=True)
-        row.prop(con, "use_z", text="Z", toggle=True)
+        row = layout.row(heading="Axis", align=True)
+        row.use_property_decorate = False
+        sub = row.row(align=True)
+        sub.prop(con, "use_x", text="X", toggle=True)
+        sub.prop(con, "use_y", text="Y", toggle=True)
+        sub.prop(con, "use_z", text="Z", toggle=True)
+        row.label(icon='BLANK1')
 
         col = layout.column()
         col.prop(con, "power")



More information about the Bf-blender-cvs mailing list