diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-22 23:10:12 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-22 23:10:12 +0300 |
commit | a7f9b57983aa8ac5a52a611634aeaf6c8191d226 (patch) | |
tree | 5297b3f567a2245ecd9108b05eedb9c9e4d1416a /source/blender | |
parent | 14b60c620f7192df270548335371c064f7afae92 (diff) |
UI: activate tabs immediately on press, and drag to quickly cycle through.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 950d156d4ed..6fc627d3847 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1829,7 +1829,7 @@ bool ui_but_is_float(const uiBut *but) bool ui_but_is_bool(const uiBut *but) { - if (ELEM(but->type, UI_BTYPE_TOGGLE, UI_BTYPE_TOGGLE_N, UI_BTYPE_ICON_TOGGLE, UI_BTYPE_ICON_TOGGLE_N)) + if (ELEM(but->type, UI_BTYPE_TOGGLE, UI_BTYPE_TOGGLE_N, UI_BTYPE_ICON_TOGGLE, UI_BTYPE_ICON_TOGGLE_N, UI_BTYPE_TAB)) return true; if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_BOOLEAN) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 9158f51f0bb..eaba2fbbc95 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3882,6 +3882,15 @@ static bool ui_but_is_mouse_over_icon_extra(const ARegion *region, uiBut *but, c static int ui_do_but_TAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event) { +#ifdef USE_DRAG_TOGGLE + { + int retval; + if (ui_do_but_ANY_drag_toggle(C, but, data, event, &retval)) { + return retval; + } + } +#endif + if (data->state == BUTTON_STATE_HIGHLIGHT) { const int rna_type = but->rnaprop ? RNA_property_type(but->rnaprop) : 0; @@ -3894,7 +3903,7 @@ static int ui_do_but_TAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButton button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); return WM_UI_HANDLER_BREAK; } - else if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && (event->val == KM_CLICK)) { + else if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && (event->val == KM_PRESS)) { button_activate_state(C, but, BUTTON_STATE_EXIT); return WM_UI_HANDLER_BREAK; } |