diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-21 04:51:32 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-21 04:51:32 +0300 |
commit | b4ba27f02621679853e9511ddbb9cfbdd60e1de8 (patch) | |
tree | 38e3b85d8e92e02d679bfcdaccb5b2ab2284c046 | |
parent | a7f1c68938f92d291172bf440aeda066a65e0154 (diff) |
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
-rw-r--r-- | release/scripts/startup/bl_ui/properties_constraint.py | 55 |
1 files changed, 32 insertions, 23 deletions
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") |