diff options
author | Ton Roosendaal <ton@blender.org> | 2011-04-04 19:01:22 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-04-04 19:01:22 +0400 |
commit | 8d1a04a2bb0b5ff894fd7ed5ee72c56e01df36fd (patch) | |
tree | ed9cea378d2c4097f44839522c4d8484175ee714 /source | |
parent | 2f3758e6d1c7c4d145650d475d54ab46f1e4a4f8 (diff) |
UI fix:
On dark menu backgrounds, the labels for Option buttons were not using
the theme colors for 'text on menu backdrop'.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 23 |
1 files changed, 23 insertions, 0 deletions
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: |