UI: Fix Hover Flickering on Selected Items

Removes hover highlight from already-selected UI items to remove unintended flickering.

Differential Revision: https://developer.blender.org/D6503

Reviewed by Campbell Barton
This commit is contained in:
Harley Acheson
2020-01-22 14:00:08 -08:00
parent 452834f1e3
commit c5c46e5b74

View File

@@ -2662,10 +2662,14 @@ static void widget_state(uiWidgetType *wt, int state, int drawflag)
if (color_blend != NULL) { if (color_blend != NULL) {
color_blend_v3_v3(wt->wcol.inner, color_blend, wcol_state->blend); color_blend_v3_v3(wt->wcol.inner, color_blend, wcol_state->blend);
} }
}
if (state & UI_ACTIVE) { /* Add "hover" highlight. Ideally this could apply in all cases,
widget_active_color(&wt->wcol); * even if UI_SELECT. But currently this causes some flickering
* as buttons can be created and updated without respect to mouse
* position and so can draw without UI_ACTIVE set. See D6503. */
if (state & UI_ACTIVE) {
widget_active_color(&wt->wcol);
}
} }
if (state & UI_BUT_REDALERT) { if (state & UI_BUT_REDALERT) {