Fix for new picker: mouse move out of menu was handled as 
restore... added new block flag UI_BLOCK_OUT_1 to denote
it shouldn't.
This commit is contained in:
Ton Roosendaal 2009-06-12 15:11:51 +00:00
parent 7910d45807
commit 63abf1ec6c
3 changed files with 8 additions and 3 deletions

@ -91,6 +91,7 @@ typedef struct uiLayout uiLayout;
#define UI_BLOCK_MOVEMOUSE_QUIT 128
#define UI_BLOCK_KEEP_OPEN 256
#define UI_BLOCK_POPUP 512
#define UI_BLOCK_OUT_1 1024
/* uiPopupBlockHandle->menuretval */
#define UI_RETURN_CANCEL 1 /* cancel all menus cascading */

@ -3812,8 +3812,12 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu,
}
/* strict check, and include the parent rect */
if(!menu->dotowards && !saferct)
menu->menuretval= (block->flag & UI_BLOCK_KEEP_OPEN)? UI_RETURN_OK: UI_RETURN_OUT;
if(!menu->dotowards && !saferct) {
if(block->flag & UI_BLOCK_OUT_1)
menu->menuretval= UI_RETURN_OK;
else
menu->menuretval= (block->flag & UI_BLOCK_KEEP_OPEN)? UI_RETURN_OK: UI_RETURN_OUT;
}
else if(menu->dotowards && event->type==MOUSEMOVE)
retval= WM_UI_HANDLER_BREAK;
}

@ -1792,7 +1792,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu
}
else {
uiBlockPickerSmall(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0);
block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1;
block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_OUT_1;
uiBoundsBlock(block, 10);
block->block_event_func= ui_picker_small_wheel;