Fix #111831: Proper Highlighting of Inactive Buttons

Deal separately with menu states of Disabled and Inactive buttons,
since we want different hover highlighting for inactive.

Pull Request: https://projects.blender.org/blender/blender/pulls/112159
This commit is contained in:
Harley Acheson
2023-09-08 19:42:47 +02:00
committed by Harley Acheson
parent 063a9e8964
commit 930dadd600

View File

@@ -2726,10 +2726,18 @@ static void widget_state_menu_item(uiWidgetType *wt,
color_blend_v3_v3(wt->wcol.inner, wt->wcol.text, 0.5f);
wt->wcol.inner[3] = 64;
}
else if (state->but_flag & (UI_BUT_DISABLED | UI_BUT_INACTIVE)) {
else if (state->but_flag & UI_BUT_DISABLED) {
/* Regular disabled. */
color_blend_v3_v3(wt->wcol.text, wt->wcol.inner, 0.5f);
}
else if (state->but_flag & UI_BUT_INACTIVE) {
/* Inactive. */
if (state->but_flag & UI_ACTIVE) {
color_blend_v3_v3(wt->wcol.inner, wt->wcol.text, 0.2f);
wt->wcol.inner[3] = 255;
}
color_blend_v3_v3(wt->wcol.text, wt->wcol.inner, 0.5f);
}
else if (state->but_flag & (UI_BUT_ACTIVE_DEFAULT | UI_SELECT_DRAW)) {
/* Currently-selected item. */
copy_v4_v4_uchar(wt->wcol.inner, wt->wcol.inner_sel);