Emulate numpad option: failed to use zero key to reset color picker.
This commit is contained in:
Ton Roosendaal 2010-12-05 12:14:02 +00:00
parent 57d1d4f78c
commit c98f5b2e4b

@ -3062,7 +3062,8 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
return WM_UI_HANDLER_BREAK;
}
else if (event->type == ZEROKEY && event->val == KM_PRESS) {
/* XXX hardcoded keymap check.... */
else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
if (but->a1==UI_GRAD_V_ALT){
int len;
@ -3183,7 +3184,8 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
return WM_UI_HANDLER_BREAK;
}
else if (event->type == ZEROKEY && event->val == KM_PRESS) {
/* XXX hardcoded keymap check.... */
else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
int len;
/* reset only saturation */
@ -3628,7 +3630,8 @@ static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandle
return WM_UI_HANDLER_BREAK;
}
else if (event->type == ZEROKEY && event->val == KM_PRESS) {
/* XXX hardcoded keymap check.... */
else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
Histogram *hist = (Histogram *)but->poin;
hist->ymax = 1.f;
@ -3710,7 +3713,8 @@ static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleB
return WM_UI_HANDLER_BREAK;
}
else if (event->type == ZEROKEY && event->val == KM_PRESS) {
/* XXX hardcoded keymap check.... */
else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
Scopes *scopes = (Scopes *)but->poin;
scopes->wavefrm_yfac = 1.f;
@ -4336,7 +4340,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
return WM_UI_HANDLER_BREAK;
}
/* reset to default */
else if(ELEM(event->type, ZEROKEY,PAD0) && event->val == KM_PRESS) {
/* XXX hardcoded keymap check.... */
else if(ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
if (!(ELEM3(but->type, HSVCIRCLE, HSVCUBE, HISTOGRAM)))
ui_set_but_default(C, but);
}