fix for UI annoyance with popups (such as new image popup) opening their menus to the right of the button.

This commit is contained in:
Campbell Barton 2013-04-22 22:32:42 +00:00
parent e066b077fb
commit 0d14a1414c

@ -2440,7 +2440,11 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
pup->block = uiBeginBlock(C, NULL, __func__, UI_EMBOSSP);
pup->block->flag |= UI_BLOCK_NUMSELECT; /* default menus to numselect */
pup->layout = uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
pup->slideout = (but && (but->block->flag & UI_BLOCK_LOOP));
pup->slideout = (but &&
/* check this is a menu */
((but->block->flag & UI_BLOCK_LOOP) != 0) &&
/* non-menu popups use keep-open, so check this is off */
((but->block->flag & UI_BLOCK_KEEP_OPEN) == 0));
pup->but = but;
uiLayoutSetOperatorContext(pup->layout, WM_OP_INVOKE_REGION_WIN);