diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 17:59:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-27 18:06:26 +0300 |
commit | ffbe5985c64f83e3a11a9c9a0af03ff551ab6f1c (patch) | |
tree | f8477ef2a6bd41d47514555c6da1d276c6335154 /source/blender/editors/interface | |
parent | c7a96651dfa47a72c3d5d7c21705ad2eaa7cc8a5 (diff) |
Fix T56547: Single column properties not aligned
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 70bcc8e7c4e..cb83f6e4f48 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -143,6 +143,7 @@ enum { /* Show an icon button next to each property (to set keyframes, show status). * Enabled by default, depends on 'UI_ITEM_PROP_SEP'. */ UI_ITEM_PROP_DECORATE = 1 << 4, + UI_ITEM_PROP_DECORATE_NO_PAD = 1 << 5, }; typedef struct uiButtonItem { @@ -810,10 +811,14 @@ static uiBut *ui_item_with_label( x, y, prop_but_width, h); } +#ifdef UI_PROP_DECORATE /* Only for alignment. */ - if ((layout->item.flag & UI_ITEM_PROP_DECORATE) != 0) { + if ((layout->item.flag & UI_ITEM_PROP_DECORATE) && + (layout->item.flag & UI_ITEM_PROP_DECORATE_NO_PAD) == 0) + { uiItemL(sub, NULL, ICON_BLANK1); } +#endif /* UI_PROP_DECORATE */ UI_block_layout_set_current(block, layout); return but; @@ -1515,8 +1520,6 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index #ifdef UI_PROP_DECORATE struct { bool use_prop_decorate; - /* For button types that handle own decorations (or add own padding for alignment). */ - bool use_prop_decorate_done; int len; uiLayout *layout; uiBut *but; @@ -1705,6 +1708,9 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index ui_decorate.layout->space = 0; UI_block_layout_set_current(block, layout); ui_decorate.but = block->buttons.last; + + /* Clear after. */ + layout->item.flag |= UI_ITEM_PROP_DECORATE_NO_PAD; } #endif /* UI_PROP_DECORATE */ } @@ -1736,11 +1742,6 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index if (layout->redalert) UI_but_flag_enable(but, UI_BUT_REDALERT); - -#ifdef UI_PROP_DECORATE - /* ui_item_with_label handles this. */ - ui_decorate.use_prop_decorate_done = true; -#endif } /* single button */ else { @@ -1762,10 +1763,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } #ifdef UI_PROP_DECORATE - if (ui_decorate.use_prop_decorate_done) { - /* pass */ - } - else if (ui_decorate.use_prop_decorate) { + if (ui_decorate.use_prop_decorate) { const bool is_anim = RNA_property_animateable(ptr, prop); uiBut *but_decorate = ui_decorate.but ? ui_decorate.but->next : block->buttons.first; uiLayout *layout_col = uiLayoutColumn(ui_decorate.layout, false); @@ -1795,6 +1793,8 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index but_decorate = but->next; } BLI_assert(ELEM(i, 1, ui_decorate.len)); + + layout->item.flag &= ~UI_ITEM_PROP_DECORATE_NO_PAD; } #endif /* UI_PROP_DECORATE */ |