diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-16 19:40:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-16 19:42:16 +0300 |
commit | a15d584a4f17c6234ed5c07214121779a790fee3 (patch) | |
tree | 0166407910f000a495de21da828384453a8d7639 | |
parent | ed52706d352334f15c1183131461a8112427ea22 (diff) |
UI: fix for recent menu flipping commit
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 15 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 4cc159d144d..2d952d66638 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -978,10 +978,8 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname MEM_freeN(item_array); } - if ((block->flag & UI_BLOCK_NO_FLIP) == 0) { - BLI_assert((block->flag & UI_BLOCK_IS_FLIP) == 0); - block->flag |= UI_BLOCK_IS_FLIP; - } + /* intentionally don't touch UI_BLOCK_IS_FLIP here, + * we don't know the context this is called in */ } else if (prop && RNA_property_type(prop) != PROP_ENUM) { RNA_warning("%s.%s, not an enum type", RNA_struct_identifier(ptr.type), propname); @@ -1437,10 +1435,8 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname } } - if ((block->flag & UI_BLOCK_NO_FLIP) == 0) { - BLI_assert((block->flag & UI_BLOCK_IS_FLIP) == 0); - block->flag |= UI_BLOCK_IS_FLIP; - } + /* intentionally don't touch UI_BLOCK_IS_FLIP here, + * we don't know the context this is called in */ } /* Pointer RNA button with search */ @@ -1869,6 +1865,8 @@ static void menu_item_enum_opname_menu(bContext *UNUSED(C), uiLayout *layout, vo uiLayoutSetOperatorContext(layout, lvl->opcontext); uiItemsEnumO(layout, lvl->opname, lvl->propname); + layout->root->block->flag |= UI_BLOCK_IS_FLIP; + /* override default, needed since this was assumed pre 2.70 */ UI_block_direction_set(layout->root->block, UI_DIR_DOWN); } @@ -1921,6 +1919,7 @@ static void menu_item_enum_rna_menu(bContext *UNUSED(C), uiLayout *layout, void uiLayoutSetOperatorContext(layout, lvl->opcontext); uiItemsEnumR(layout, &lvl->rnapoin, lvl->propname); + layout->root->block->flag |= UI_BLOCK_IS_FLIP; } void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, int icon) diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 7cc4bcae7b6..6a4bf230591 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2640,7 +2640,7 @@ uiPopupMenu *UI_popup_menu_begin(bContext *C, const char *title, int icon) uiBut *but; pup->block = UI_block_begin(C, NULL, __func__, UI_EMBOSS_PULLDOWN); - pup->block->flag |= UI_BLOCK_POPUP_MEMORY; + pup->block->flag |= UI_BLOCK_POPUP_MEMORY | UI_BLOCK_IS_FLIP; pup->block->puphash = ui_popup_menu_hash(title); pup->layout = UI_block_layout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, MENU_PADDING, style); |