diff options
author | Ton Roosendaal <ton@blender.org> | 2013-08-26 13:59:51 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2013-08-26 13:59:51 +0400 |
commit | aa6eac3aad850c543fe32c15c81cf6edcc0533dd (patch) | |
tree | c6123afff13fd1c751a9562b99c63d7251e24bbb /source/blender/editors | |
parent | 762e7da97606190bfd533e126f510ac623703523 (diff) |
Bugfix #36324
Commit 57760, June this year, broke Theme colors for Label Buttons.
All labels, in every editor or region, now were using same color.
These colors have to be derived from the Editor settings. Code for
this was mistakingly removed.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 594d3e40dcd..30988acff15 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2850,6 +2850,16 @@ static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UN rect->xmin += BLI_rcti_size_y(rect) * 0.7 + delta; } +/* labels use Editor theme colors for text */ +static void widget_state_label(uiWidgetType *wt, int state) +{ + /* call this for option button */ + widget_state(wt, state); + if (state & UI_SELECT) + UI_GetThemeColor3ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text); + else + UI_GetThemeColor3ubv(TH_TEXT, (unsigned char *)wt->wcol.text); +} static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign) { @@ -2973,6 +2983,7 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) /* fall-through */ /* we use usual label code too. */ case UI_WTYPE_LABEL: wt.draw = NULL; + wt.state = widget_state_label; break; case UI_WTYPE_TOGGLE: |