Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
| Context not available. | |||||
| button_activate_state(C, but, BUTTON_STATE_EXIT); | button_activate_state(C, but, BUTTON_STATE_EXIT); | ||||
| return WM_UI_HANDLER_BREAK; | return WM_UI_HANDLER_BREAK; | ||||
| } | } | ||||
| if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->ctrl) { | if (ELEM(event->type, MOUSEPAN, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->ctrl) { | ||||
| /* Support alt+wheel on expanded enum rows */ | /* Support alt-wheel on expanded enum rows. */ | ||||
| if (but->type == UI_BTYPE_ROW) { | if (but->type == UI_BTYPE_ROW) { | ||||
| const int direction = (event->type == WHEELDOWNMOUSE) ? -1 : 1; | int type = event->type; | ||||
| int val = event->val; | |||||
| /* Convert pan to scroll-wheel. */ | |||||
| if (type == MOUSEPAN) { | |||||
| ui_pan_to_scroll(event, &type, &val); | |||||
| if (type == MOUSEPAN) { | |||||
| return WM_UI_HANDLER_BREAK; | |||||
| } | |||||
| } | |||||
| const int direction = (type == WHEELDOWNMOUSE) ? -1 : 1; | |||||
| uiBut *but_select = ui_but_find_select_in_enum(but, direction); | uiBut *but_select = ui_but_find_select_in_enum(but, direction); | ||||
| if (but_select) { | if (but_select) { | ||||
| uiBut *but_other = (direction == -1) ? but_select->next : but_select->prev; | uiBut *but_other = (direction == -1) ? but_select->next : but_select->prev; | ||||
| Context not available. | |||||
| return WM_UI_HANDLER_BREAK; | return WM_UI_HANDLER_BREAK; | ||||
| } | } | ||||
| if (but->type == UI_BTYPE_MENU) { | if (but->type == UI_BTYPE_MENU) { | ||||
| if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->ctrl) { | if (ELEM(event->type, MOUSEPAN, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->ctrl) { | ||||
| const int direction = (event->type == WHEELDOWNMOUSE) ? 1 : -1; | int type = event->type; | ||||
| int val = event->val; | |||||
| /* Convert pan to scroll-wheel. */ | |||||
| if (type == MOUSEPAN) { | |||||
| ui_pan_to_scroll(event, &type, &val); | |||||
| if (type == MOUSEPAN) { | |||||
| return WM_UI_HANDLER_BREAK; | |||||
| } | |||||
| } | |||||
| const int direction = (type == WHEELDOWNMOUSE) ? 1 : -1; | |||||
| data->value = ui_but_menu_step(but, direction); | data->value = ui_but_menu_step(but, direction); | ||||
| Context not available. | |||||