Fix 3D View panel header color wrong after theme reset
authorJulian Eisel <eiseljulian@gmail.com>
Tue, 3 May 2016 16:26:58 +0000 (18:26 +0200)
committerJulian Eisel <eiseljulian@gmail.com>
Tue, 3 May 2016 16:31:37 +0000 (18:31 +0200)
Caused by wrong alpha value in rB34b30f847429ac (used 0.01, should've been 0.1). Also made sure all editors initialize same default theme values for panels and cleaned up code a bit.
Works fine with old userpref.blend files.

source/blender/editors/interface/resources.c

index 3c862666aa6c24687e605815b278ec8997e5b0f1..e2e2413c717f213b2a03bb2c57fb77d6d5f5efa5 100644 (file)
@@ -786,9 +786,14 @@ static void ui_theme_init_new_do(ThemeSpace *ts)
        rgba_char_args_set(ts->panel_text_hi,  255, 255, 255, 255);
 #endif
 
+       ts->panelcolors.show_back = false;
+       ts->panelcolors.show_header = false;
+       rgba_char_args_set(ts->panelcolors.back,   114, 114, 114, 128);
+       rgba_char_args_set(ts->panelcolors.header, 0, 0, 0, 25);
+
        rgba_char_args_set(ts->button,         145, 145, 145, 245);
        rgba_char_args_set(ts->button_title,   0, 0, 0, 255);
-       rgba_char_args_set(ts->button_text,        0, 0, 0, 255);
+       rgba_char_args_set(ts->button_text,    0, 0, 0, 255);
        rgba_char_args_set(ts->button_text_hi, 255, 255, 255, 255);
 
        rgba_char_args_set(ts->list,           165, 165, 165, 255);
@@ -848,14 +853,9 @@ void ui_theme_init_default(void)
 
        /* UI buttons */
        ui_widget_color_init(&btheme->tui);
-       
+
        btheme->tui.iconfile[0] = 0;
-       btheme->tui.panel.show_back = false;
-       btheme->tui.panel.show_header = false;
-       rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
-       
        rgba_char_args_set(btheme->tui.wcol_tooltip.text, 255, 255, 255, 255);
-       
        rgba_char_args_set_fl(btheme->tui.widget_emboss, 1.0f, 1.0f, 1.0f, 0.02f);
 
        rgba_char_args_set(btheme->tui.xaxis, 220,   0,   0, 255);
@@ -872,10 +872,6 @@ void ui_theme_init_default(void)
        ui_theme_init_new(btheme);
        
        /* space view3d */
-       btheme->tv3d.panelcolors.show_back = false;
-       btheme->tv3d.panelcolors.show_header = false;
-       rgba_char_args_set_fl(btheme->tv3d.panelcolors.back, 0.45, 0.45, 0.45, 0.5);
-       rgba_char_args_set_fl(btheme->tv3d.panelcolors.header, 0, 0, 0, 0.01);
        rgba_char_args_set_fl(btheme->tv3d.back,       0.225, 0.225, 0.225, 1.0);
        rgba_char_args_set(btheme->tv3d.text,       0, 0, 0, 255);
        rgba_char_args_set(btheme->tv3d.text_hi, 255, 255, 255, 255);