[Bf-blender-cvs] [19955bd] master: Fix T48447: Inactive menu items don't grey-out icons

Campbell Barton noreply at git.blender.org
Mon May 16 16:09:58 CEST 2016


Commit: 19955bd15209a92b1604e4c4894e8cce2546d9a5
Author: Campbell Barton
Date:   Tue May 17 00:15:21 2016 +1000
Branches: master
https://developer.blender.org/rB19955bd15209a92b1604e4c4894e8cce2546d9a5

Fix T48447: Inactive menu items don't grey-out icons

===================================================================

M	source/blender/editors/interface/interface_widgets.c

===================================================================

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index d1461f1..19e0b55 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -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);




More information about the Bf-blender-cvs mailing list