UI: allow to cancel editing of vector widgets with escape and RMB

Differential Revision: https://developer.blender.org/D4838
This commit is contained in:
Alessio Monti di Sopra 2019-05-10 17:21:24 +02:00 committed by Brecht Van Lommel
parent 1813b26bbc
commit e7e14934f8
1 changed files with 7 additions and 0 deletions

View File

@ -5622,6 +5622,13 @@ static int ui_do_but_UNITVEC(
}
}
}
else if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
}
else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}