UI: enum property menus now expand down, consistent with other menus.
authorMikhail Rachinskiy <alm>
Thu, 21 Feb 2019 17:16:25 +0000 (18:16 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 21 Feb 2019 17:20:05 +0000 (18:20 +0100)
Differential Revision: https://developer.blender.org/D4359

source/blender/editors/interface/interface_region_menu_popup.c

index 0f3e9371ee9c67e3f128e9635fb6b622d9beb4c1..52fd9efe2cdf3e937fe40f84d3fabf7216956138 100644 (file)
@@ -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];