Fix T48447: Inactive menu items don't grey-out icons
authorCampbell Barton <ideasman42@gmail.com>
Mon, 16 May 2016 14:15:21 +0000 (00:15 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 16 May 2016 14:17:26 +0000 (00:17 +1000)
source/blender/editors/interface/interface_widgets.c

index d1461f1acecd66c6fee3d127e717b343c3596c1b..19e0b55374ef93f78578cdeefe01e7e45c407bbc 100644 (file)
@@ -859,10 +859,17 @@ static void widget_draw_icon(
                else if (but->flag & UI_ACTIVE) {}
                else alpha = 0.5f;
        }
-       
-       /* extra feature allows more alpha blending */
-       if ((but->type == UI_BTYPE_LABEL) && but->a1 == 1.0f)
-               alpha *= but->a2;
+       else if ((but->type == UI_BTYPE_LABEL)) {
+               /* extra feature allows more alpha blending */
+               if (but->a1 == 1.0f) {
+                       alpha *= but->a2;
+               }
+       }
+       else if (ELEM(but->type, UI_BTYPE_BUT)) {
+               if (but->flag & UI_BUT_DISABLED) {
+                       alpha *= 0.5f;
+               }
+       }
        
        glEnable(GL_BLEND);