On dark menu backgrounds, the labels for Option buttons were not using
the theme colors for 'text on menu backdrop'.
This commit is contained in:
2011-04-04 15:01:22 +00:00
parent 2f3758e6d1
commit 8d1a04a2bb

View File

@@ -1554,6 +1554,24 @@ static void widget_state_label(uiWidgetType *wt, int state)
}
/* labels use theme colors for text */
static void widget_state_option_menu(uiWidgetType *wt, int state)
{
/* call this for option button */
widget_state(wt, state);
/* if not selected we get theme from menu back */
if(state & UI_SELECT)
UI_GetThemeColor4ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text);
else {
bTheme *btheme= U.themes.first; /* XXX */
VECCOPY(wt->wcol.text, btheme->tui.wcol_menu_back.text);
}
}
static void widget_state_nothing(uiWidgetType *wt, int UNUSED(state))
{
wt->wcol= *(wt->wcol_theme);
@@ -2938,6 +2956,11 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
}
else
wt= widget_type(UI_WTYPE_TOGGLE);
/* option buttons have strings outside, on menus use different colors */
if(but->block->flag & UI_BLOCK_LOOP)
wt->state= widget_state_option_menu;
break;
case MENU: