diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-28 16:45:19 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-28 16:45:19 +0300 |
commit | 01a348274218103ecdbaddc699a97e86f0c4ce18 (patch) | |
tree | 4e5358f062960bc88b2102ce5355fafd44b8b37d /source/blender/editors/interface/interface_handlers.c | |
parent | 5536be2cfe77a2bd0281df4b2cb826b7176054f4 (diff) | |
parent | cdd223039b1ce5670ac62163dfa288e2b7f90123 (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ab70d4b87e1..d3ffdd5386f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -9551,18 +9551,29 @@ static int ui_handle_menu_event(bContext *C, break; case WHEELUPMOUSE: - case WHEELDOWNMOUSE: { + case WHEELDOWNMOUSE: + case MOUSEPAN: { if (IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) { /* pass */ } else if (!ui_block_is_menu(block)) { - const int scroll_dir = (event->type == WHEELUPMOUSE) ? 1 : -1; - if (ui_menu_scroll_step(ar, block, scroll_dir)) { - if (but) { - but->active->cancel = true; - button_activate_exit(C, but, but->active, false, false); + int type = event->type; + int val = event->val; + + /* convert pan to scrollwheel */ + if (type == MOUSEPAN) { + ui_pan_to_scroll(event, &type, &val); + } + + if (type != MOUSEPAN) { + const int scroll_dir = (type == WHEELUPMOUSE) ? 1 : -1; + if (ui_menu_scroll_step(ar, block, scroll_dir)) { + if (but) { + but->active->cancel = true; + button_activate_exit(C, but, but->active, false, false); + } + WM_event_add_mousemove(C); } - WM_event_add_mousemove(C); } break; } @@ -9574,7 +9585,6 @@ static int ui_handle_menu_event(bContext *C, case PAGEDOWNKEY: case HOMEKEY: case ENDKEY: - case MOUSEPAN: /* arrowkeys: only handle for block_loop blocks */ if (IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) { /* pass */ |