Popup menus were tagged with wrong direction, so arrow keys or
scrollwheel didn't work.
This commit is contained in:
Ton Roosendaal 2009-01-10 14:03:00 +00:00
parent 9f0afbe804
commit a7932f7452
2 changed files with 5 additions and 5 deletions

@ -3338,14 +3338,13 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiMenuBlockHandle *menu, i
if(inside || (block->flag & UI_BLOCK_LOOP)) {
if(event->val) {
but= ui_but_find_activated(ar);
if(but) {
if(ELEM(event->type, UPARROWKEY, WHEELUPMOUSE)) {
if(block->direction & UI_TOP) but= ui_but_next(but);
if(ELEM(event->type, DOWNARROWKEY, WHEELDOWNMOUSE)) {
if(block->direction & UI_DOWN) but= ui_but_next(but);
else but= ui_but_prev(but);
}
else {
if(block->direction & UI_TOP) but= ui_but_prev(but);
if(block->direction & UI_DOWN) but= ui_but_prev(but);
else but= ui_but_next(but);
}

@ -672,7 +672,6 @@ uiMenuBlockHandle *ui_menu_block_create(bContext *C, ARegion *butregion, uiBut *
saferct= MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
saferct->safety= block->safety;
BLI_addhead(&block->saferct, saferct);
block->direction= UI_TOP;
}
/* the block and buttons were positioned in window space as in 2.4x, now
@ -1340,6 +1339,7 @@ uiBlock *ui_block_func_PUPMENU(bContext *C, uiMenuBlockHandle *handle, void *arg
block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
block->themecol= TH_MENU_ITEM;
block->direction= UI_DOWN;
md= decompose_menu_string(info->instr);
@ -1503,6 +1503,7 @@ uiBlock *ui_block_func_PUPMENUCOL(bContext *C, uiMenuBlockHandle *handle, void *
block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
block->themecol= TH_MENU_ITEM;
block->direction= UI_DOWN;
md= decompose_menu_string(info->instr);