Fix T78428: Checkbox labels don't highlight on mouse-over in popovers
The text colors set by the general widget state function (`widget_state()`) would always be overriden by the menu-back text colors to avoid contrast issues. This would only respect the selected state, not other states. Address this now by changing the input theme colors to use the menu-back ones, rather than overriding after the fact (calling `widget_state()`).
This commit is contained in:
parent
33e6562a8a
commit
14b77b37cb
Notes:
blender-bot
2023-02-14 09:36:46 +01:00
Referenced by issue #78428, Checkbox labels don't highlight on mouse-over in popovers
|
@ -2622,18 +2622,19 @@ static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag)
|
|||
/* labels use theme colors for text */
|
||||
static void widget_state_option_menu(uiWidgetType *wt, int state, int drawflag)
|
||||
{
|
||||
bTheme *btheme = UI_GetTheme(); /* XXX */
|
||||
const bTheme *btheme = UI_GetTheme();
|
||||
|
||||
const uiWidgetColors *old_wcol = wt->wcol_theme;
|
||||
uiWidgetColors wcol_menu_option = *wt->wcol_theme;
|
||||
|
||||
/* Override the checkbox theme colors to use the menu-back text colors. */
|
||||
copy_v3_v3_uchar(wcol_menu_option.text, btheme->tui.wcol_menu_back.text);
|
||||
copy_v3_v3_uchar(wcol_menu_option.text_sel, btheme->tui.wcol_menu_back.text_sel);
|
||||
wt->wcol_theme = &wcol_menu_option;
|
||||
|
||||
/* call this for option button */
|
||||
widget_state(wt, state, drawflag);
|
||||
|
||||
/* if not selected we get theme from menu back */
|
||||
if (state & UI_SELECT) {
|
||||
copy_v3_v3_uchar(wt->wcol.text, btheme->tui.wcol_menu_back.text_sel);
|
||||
}
|
||||
else {
|
||||
copy_v3_v3_uchar(wt->wcol.text, btheme->tui.wcol_menu_back.text);
|
||||
}
|
||||
wt->wcol_theme = old_wcol;
|
||||
}
|
||||
|
||||
static void widget_state_nothing(uiWidgetType *wt, int UNUSED(state), int UNUSED(drawflag))
|
||||
|
|
Loading…
Reference in New Issue