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 | |
parent | 5536be2cfe77a2bd0281df4b2cb826b7176054f4 (diff) | |
parent | cdd223039b1ce5670ac62163dfa288e2b7f90123 (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 26 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 |
2 files changed, 19 insertions, 9 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 */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 8ed4c3a7e83..41606fce915 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1509,7 +1509,7 @@ static void icon_draw_rect(float x, return; } /* modulate color */ - float col[4] = {1.0f, 1.0f, 1.0f, alpha}; + float col[4] = {alpha, alpha, alpha, alpha}; /* rect contains image in 'rendersize', we only scale if needed */ if (rw != w || rh != h) { |