Bugfix #36324
authorTon Roosendaal <ton@blender.org>
Mon, 26 Aug 2013 09:59:51 +0000 (09:59 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 26 Aug 2013 09:59:51 +0000 (09:59 +0000)
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.

source/blender/editors/interface/interface_widgets.c

index 594d3e40dcddf038dc4e8f58b810a871224feb61..30988acff151177b40013bde64e998fcef06ece9 100644 (file)
@@ -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: