diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-21 19:45:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-21 19:45:17 +0400 |
commit | 0fd2448c8b392363041b1ffc450c2fef23bc90ce (patch) | |
tree | 77b61ff63181b4d08ecb8f988737ba4fd4fef2f6 /source | |
parent | 3090ae35afe478435a77be6a9c1be913fe406242 (diff) |
alt+wheel scrolling over the render slots works again (this didnt support scrolling when new interfaces would replace the old ones).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ce0ec310ac3..957482bb379 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2945,9 +2945,11 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm return WM_UI_HANDLER_BREAK; } else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) { - - if (event->type == WHEELDOWNMOUSE && event->alt) { - data->value = ui_step_name_menu(but, -1); + if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) { + const int direction = (event->type == WHEELDOWNMOUSE) ? -1 : 1; + + data->value = ui_step_name_menu(but, direction); + button_activate_state(C, but, BUTTON_STATE_EXIT); ui_apply_button(C, but->block, but, data, 1); @@ -2961,16 +2963,15 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm data->postbut = but; data->posttype = BUTTON_ACTIVATE_OVER; - return WM_UI_HANDLER_BREAK; - } - else if (event->type == WHEELUPMOUSE && event->alt) { - data->value = ui_step_name_menu(but, 1); - button_activate_state(C, but, BUTTON_STATE_EXIT); - ui_apply_button(C, but->block, but, data, 1); - - /* why this is needed described above */ - data->postbut = but; - data->posttype = BUTTON_ACTIVATE_OVER; + /* without this, a new interface that draws as result of the menu change + * won't register that the mouse is over it, eg: + * Alt+MouseWheel over the render slots, without this, + * the slot menu fails to switch a second time. + * + * Theactive state of the button could be maintained some other way + * and remove this mousemove event. + */ + WM_event_add_mousemove(C); return WM_UI_HANDLER_BREAK; } |