Fix #29155: Inconsistency with 0 and Del hotkeys
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 Nov 2011 15:53:12 +0000 (15:53 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 Nov 2011 15:53:12 +0000 (15:53 +0000)
Use del key to reset values in widgets like color selection and histogram.

source/blender/editors/interface/interface_handlers.c

index b77f3977355ba4a5951104deda030f6b0adb5c2a..0ba141163b351a33798b647c2ef0b01c48421804 100644 (file)
@@ -3306,7 +3306,7 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
                        return WM_UI_HANDLER_BREAK;
                }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        if (but->a1==UI_GRAD_V_ALT){
                                int len;
                                
@@ -3489,7 +3489,7 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
                        return WM_UI_HANDLER_BREAK;
                }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        int len;
                        
                        /* reset only saturation */
@@ -3938,7 +3938,7 @@ static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandle
                        return WM_UI_HANDLER_BREAK;
                }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        Histogram *hist = (Histogram *)but->poin;
                        hist->ymax = 1.f;
                        
@@ -4021,7 +4021,7 @@ static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleB
                        return WM_UI_HANDLER_BREAK;
                }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        Scopes *scopes = (Scopes *)but->poin;
                        scopes->wavefrm_yfac = 1.f;