diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-24 05:09:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-24 05:11:24 +0300 |
commit | 7fa42b3e519173c29a2ae250cea15f35e32521c2 (patch) | |
tree | d19e8abfdfeed146a0d544622ed7cc82c1935b4d /source/blender/editors | |
parent | bae8ab3188b33635f90f840fccdc6517a3dae22b (diff) |
Fix T56511: UILayout.prop_search misaligned
Add padding when used with property decorations.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index ec35325416a..a9703736916 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -809,6 +809,11 @@ static uiBut *ui_item_with_label( x, y, prop_but_width, h); } + /* Only for alignment. */ + if ((layout->item.flag & UI_ITEM_PROP_DECORATE) != 0) { + uiItemL(sub, NULL, ICON_BLANK1); + } + UI_block_layout_set_current(block, layout); return but; } @@ -1509,6 +1514,8 @@ 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; @@ -1728,6 +1735,11 @@ 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 { @@ -1749,7 +1761,10 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } #ifdef UI_PROP_DECORATE - if (ui_decorate.use_prop_decorate) { + if (ui_decorate.use_prop_decorate_done) { + /* pass */ + } + else 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); |