UI: activate tabs immediately on press, and drag to quickly cycle through.
This commit is contained in:
parent
14b60c620f
commit
a7f9b57983
Notes:
blender-bot
2023-02-14 10:54:29 +01:00
Referenced by issue #61274, Duplicate current workspace makes the workspace menu disappear Referenced by issue #57753, Dragging over the Properties tabs should switch context as you drag down the list
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue