diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-18 08:52:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-18 09:05:46 +0300 |
commit | a794da5200b20c3abaefa4a64624401be3af61cc (patch) | |
tree | 8b40bf7acefdc70a8c93190b5b587b019b41d1df | |
parent | 05b99b763ef7635372b6423ef9602c6193a23062 (diff) |
Fix T55517: Property-split fails w/ expanded enum
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 9348ee1fe3a..1ce34fec118 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1488,6 +1488,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index #ifdef UI_PROP_DECORATE struct { bool use_prop_decorate; + int len; uiLayout *layout; uiBut *but; } ui_decorate = { @@ -1583,6 +1584,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index if (ui_decorate.use_prop_decorate) { layout_row = uiLayoutRow(layout, true); layout_row->space = 0; + ui_decorate.len = 1; } #endif /* UI_PROP_DECORATE */ @@ -1621,6 +1623,10 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index but->drawflag |= UI_BUT_TEXT_RIGHT; but->drawflag &= ~UI_BUT_TEXT_LEFT; } + +#ifdef UI_PROP_DECORATE + ui_decorate.len = len; +#endif } else { if (name) { @@ -1635,7 +1641,12 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index /* Watch out! We can only write into the new column now. */ layout = uiLayoutColumn(layout_split, true); layout->space = 0; - name = ""; + if ((type == PROP_ENUM) && (flag & UI_ITEM_R_EXPAND)) { + /* pass (expanded enums each have their own name) */ + } + else { + name = ""; + } } #ifdef UI_PROP_DECORATE @@ -1702,7 +1713,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index layout_col->space = 0; layout_col->emboss = UI_EMBOSS_NONE; int i; - for (i = 0; but_decorate; i++) { + for (i = 0; i < ui_decorate.len && but_decorate; i++) { /* The icons are set in 'ui_but_anim_flag' */ if (is_anim) { but = uiDefIconBut( @@ -1724,7 +1735,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index BLI_insertlinkafter(&block->buttons, but_decorate, but); but_decorate = but->next; } - BLI_assert(len ? (ELEM(i, 1, len)) : i == 1); + BLI_assert(ELEM(i, 1, ui_decorate.len)); } #endif /* UI_PROP_DECORATE */ |