From 8d1a04a2bb0b5ff894fd7ed5ee72c56e01df36fd Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 4 Apr 2011 15:01:22 +0000 Subject: [PATCH] UI fix: On dark menu backgrounds, the labels for Option buttons were not using the theme colors for 'text on menu backdrop'. --- .../editors/interface/interface_widgets.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 29b4779bc69..fc29a18154a 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -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: