[Bf-blender-cvs] [4dd575e5ab5] master: UI: enum property menus now expand down, consistent with other menus.
Mikhail Rachinskiy
noreply at git.blender.org
Thu Feb 21 18:20:42 CET 2019
Commit: 4dd575e5ab55e153f8b745360bed6a9e065ae899
Author: Mikhail Rachinskiy
Date: Thu Feb 21 18:16:25 2019 +0100
Branches: master
https://developer.blender.org/rB4dd575e5ab55e153f8b745360bed6a9e065ae899
UI: enum property menus now expand down, consistent with other menus.
Differential Revision: https://developer.blender.org/D4359
===================================================================
M source/blender/editors/interface/interface_region_menu_popup.c
===================================================================
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c
index 0f3e9371ee9..52fd9efe2cd 100644
--- a/source/blender/editors/interface/interface_region_menu_popup.c
+++ b/source/blender/editors/interface/interface_region_menu_popup.c
@@ -193,19 +193,12 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
minwidth = UI_MENU_WIDTH_MIN;
}
- /* settings (typically rna-enum-popups) show above the button,
- * menu's like file-menu, show below */
if (pup->block->direction != 0) {
/* allow overriding the direction from menu_func */
direction = pup->block->direction;
}
- else if ((pup->but->type == UI_BTYPE_PULLDOWN) ||
- (UI_but_menutype_get(pup->but) != NULL))
- {
- direction = UI_DIR_DOWN;
- }
else {
- direction = UI_DIR_UP;
+ direction = UI_DIR_DOWN;
}
}
else {
@@ -229,6 +222,13 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT);
+ /* Flip layout because rna enum list ordered in reverse. */
+ if ((pup->but && pup->but->type != UI_BTYPE_PULLDOWN) &&
+ (UI_but_menutype_get(pup->but) == NULL))
+ {
+ UI_block_order_flip(block);
+ }
+
if (pup->popup) {
uiBut *bt;
int offset[2];
More information about the Bf-blender-cvs
mailing list