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

This commit is contained in:
Campbell Barton 2016-05-17 00:15:21 +10:00
parent 575d7a9666
commit 19955bd152
Notes: blender-bot 2023-02-14 07:53:45 +01:00
Referenced by issue #48447, Inactive Menu entries don't gray out Icons like text
1 changed files with 11 additions and 4 deletions

View 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);