Theme support for console background. Thx cam for help!
authorDaniel Salazar <zanqdo@gmail.com>
Thu, 11 Feb 2010 16:28:31 +0000 (16:28 +0000)
committerDaniel Salazar <zanqdo@gmail.com>
Thu, 11 Feb 2010 16:28:31 +0000 (16:28 +0000)
release/scripts/ui/space_userpref.py
source/blender/editors/interface/resources.c
source/blender/editors/space_console/space_console.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index 930855d..faa64a8 100644 (file)
@@ -951,6 +951,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
 
             col = split.column()
             col.prop(prefs, "header")
+            col.prop(prefs, "background")
 
             col = split.column()
             col.prop(prefs, "line_output")
index 785cb63..02d8ae4 100644 (file)
@@ -353,6 +353,8 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
                                cp= ts->console_info; break;
                        case TH_CONSOLE_ERROR:
                                cp= ts->console_error; break;
+                       case TH_BACK:
+                               cp= ts->console_back; break;
 
                        case TH_HANDLE_VERTEX:
                                cp= ts->handle_vertex;
@@ -621,6 +623,7 @@ void ui_theme_init_userdef(void)
        SETCOL(btheme->tconsole.console_input, 255, 255, 255, 255);
        SETCOL(btheme->tconsole.console_info, 0, 170, 0, 255);
        SETCOL(btheme->tconsole.console_error, 220, 96, 96, 255);
+       SETCOL(btheme->tconsole.console_back, 0, 0, 0, 255);
        
 
        /* space sound */
index ea1d666..4e9427d 100644 (file)
@@ -162,15 +162,14 @@ static void console_main_area_draw(const bContext *C, ARegion *ar)
        SpaceConsole *sc= CTX_wm_space_console(C);
        View2D *v2d= &ar->v2d;
        View2DScrollers *scrollers;
-       //float col[3];
+       float col[3];
        
        if((sc->type==CONSOLE_TYPE_PYTHON) && (sc->scrollback.first==NULL))
                WM_operator_name_call((bContext *)C, "CONSOLE_OT_banner", WM_OP_EXEC_DEFAULT, NULL);
 
        /* clear and setup matrix */
-       //UI_GetThemeColor3fv(TH_BACK, col);
-       //glClearColor(col[0], col[1], col[2], 0.0);
-       glClearColor(0, 0, 0, 1.0);
+       UI_GetThemeColor3fv(TH_BACK, col);
+       glClearColor(col[0], col[1], col[2], 1.0);
        glClear(GL_COLOR_BUFFER_BIT);
 
        console_update_rect(C, ar);
index a83836f..12ca52e 100644 (file)
@@ -202,7 +202,7 @@ typedef struct ThemeSpace {
        char cframe[4];
        char ds_channel[4], ds_subchannel[4]; // dopesheet
        
-       char console_output[4], console_input[4], console_info[4], console_error[4], console_back[4]; // Console (todo - console_back)
+       char console_output[4], console_input[4], console_info[4], console_error[4], console_back[4];
        
        char vertex_size, facedot_size;
        char bpad[2];
index eff40cd..64d4465 100644 (file)
@@ -987,6 +987,12 @@ static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
        RNA_def_property_array(prop, 3);
        RNA_def_property_ui_text(prop, "Line Error", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+       prop= RNA_def_property(srna, "background", PROP_FLOAT, PROP_COLOR);
+       RNA_def_property_float_sdna(prop, NULL, "console_back");
+       RNA_def_property_array(prop, 3);
+       RNA_def_property_ui_text(prop, "Background", "");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
 }
 
 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)