forked from bartvdbraak/blender
Console:
* Added Theme support for the console. You can change: -Header Color -Text Color of Output, Input, Info and Error Messages. (Inside the User Preferences -> Themes)
This commit is contained in:
parent
3ff987c46a
commit
1b580dde6e
@ -920,6 +920,19 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "header_text")
|
||||
|
||||
elif theme.theme_area == 'CONSOLE':
|
||||
prefs = theme.console
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "header")
|
||||
|
||||
col = split.column()
|
||||
col.prop(prefs, "line_output")
|
||||
col.prop(prefs, "line_input")
|
||||
col.prop(prefs, "line_info")
|
||||
col.prop(prefs, "line_error")
|
||||
|
||||
|
||||
|
||||
class USERPREF_PT_file(bpy.types.Panel):
|
||||
|
@ -184,6 +184,11 @@ enum {
|
||||
TH_NODE_CONVERTOR,
|
||||
TH_NODE_GROUP,
|
||||
|
||||
TH_CONSOLE_OUTPUT,
|
||||
TH_CONSOLE_INPUT,
|
||||
TH_CONSOLE_INFO,
|
||||
TH_CONSOLE_ERROR,
|
||||
|
||||
TH_SEQ_MOVIE,
|
||||
TH_SEQ_IMAGE,
|
||||
TH_SEQ_SCENE,
|
||||
|
@ -154,6 +154,9 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
|
||||
case SPACE_USERPREF:
|
||||
ts= &btheme->tuserpref;
|
||||
break;
|
||||
case SPACE_CONSOLE:
|
||||
ts= &btheme->tconsole;
|
||||
break;
|
||||
case SPACE_TIME:
|
||||
ts= &btheme->ttime;
|
||||
break;
|
||||
@ -340,6 +343,15 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
|
||||
case TH_SEQ_META:
|
||||
cp= ts->meta; break;
|
||||
|
||||
case TH_CONSOLE_OUTPUT:
|
||||
cp= ts->console_output; break;
|
||||
case TH_CONSOLE_INPUT:
|
||||
cp= ts-> console_input; break;
|
||||
case TH_CONSOLE_INFO:
|
||||
cp= ts->console_info; break;
|
||||
case TH_CONSOLE_ERROR:
|
||||
cp= ts->console_error; break;
|
||||
|
||||
case TH_HANDLE_VERTEX:
|
||||
cp= ts->handle_vertex;
|
||||
break;
|
||||
@ -407,6 +419,7 @@ static void ui_theme_init_new(bTheme *btheme)
|
||||
ui_theme_init_new_do(&btheme->tnode);
|
||||
ui_theme_init_new_do(&btheme->tlogic);
|
||||
ui_theme_init_new_do(&btheme->tuserpref);
|
||||
ui_theme_init_new_do(&btheme->tconsole);
|
||||
|
||||
}
|
||||
|
||||
@ -594,6 +607,14 @@ void ui_theme_init_userdef(void)
|
||||
/* space user preferences */
|
||||
btheme->tuserpref= btheme->tv3d;
|
||||
SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
|
||||
|
||||
/* space console */
|
||||
btheme->tconsole= btheme->tv3d;
|
||||
SETCOL(btheme->tconsole.console_output, 96, 128, 255, 255);
|
||||
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);
|
||||
|
||||
|
||||
/* space sound */
|
||||
btheme->tsnd= btheme->tv3d;
|
||||
|
@ -78,16 +78,20 @@ static void console_line_color(unsigned char *fg, int type)
|
||||
{
|
||||
switch(type) {
|
||||
case CONSOLE_LINE_OUTPUT:
|
||||
fg[0]=96; fg[1]=128; fg[2]=255;
|
||||
UI_GetThemeColor3ubv(TH_CONSOLE_OUTPUT, fg);
|
||||
fg[0], fg[1], fg[2];
|
||||
break;
|
||||
case CONSOLE_LINE_INPUT:
|
||||
fg[0]=255; fg[1]=255; fg[2]=255;
|
||||
UI_GetThemeColor3ubv(TH_CONSOLE_INPUT, fg);
|
||||
fg[0], fg[1], fg[2];
|
||||
break;
|
||||
case CONSOLE_LINE_INFO:
|
||||
fg[0]=0; fg[1]=170; fg[2]=0;
|
||||
UI_GetThemeColor3ubv(TH_CONSOLE_INFO, fg);
|
||||
fg[0], fg[1], fg[2];
|
||||
break;
|
||||
case CONSOLE_LINE_ERROR:
|
||||
fg[0]=220; fg[1]=96; fg[2]=96;
|
||||
UI_GetThemeColor3ubv(TH_CONSOLE_ERROR, fg);
|
||||
fg[0], fg[1], fg[2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -201,6 +201,8 @@ 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
|
||||
|
||||
char vertex_size, facedot_size;
|
||||
char bpad[2];
|
||||
|
||||
@ -261,6 +263,7 @@ typedef struct bTheme {
|
||||
ThemeSpace tnode;
|
||||
ThemeSpace tlogic;
|
||||
ThemeSpace tuserpref;
|
||||
ThemeSpace tconsole;
|
||||
|
||||
/* 20 sets of bone colors for this theme */
|
||||
ThemeWireColor tarm[20];
|
||||
|
@ -492,6 +492,7 @@ extern StructRNA RNA_TextureSlot;
|
||||
extern StructRNA RNA_Theme;
|
||||
extern StructRNA RNA_ThemeAudioWindow;
|
||||
extern StructRNA RNA_ThemeBoneColorSet;
|
||||
extern StructRNA RNA_ThemeConsole;
|
||||
extern StructRNA RNA_ThemeDopeSheet;
|
||||
extern StructRNA RNA_ThemeFileBrowser;
|
||||
extern StructRNA RNA_ThemeFontStyle;
|
||||
|
@ -906,6 +906,44 @@ static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
|
||||
rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
|
||||
}
|
||||
|
||||
static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* space_console */
|
||||
|
||||
srna= RNA_def_struct(brna, "ThemeConsole", NULL);
|
||||
RNA_def_struct_sdna(srna, "ThemeSpace");
|
||||
RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console.");
|
||||
|
||||
rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE);
|
||||
|
||||
prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "console_output");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Line Output", "");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
||||
|
||||
prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "console_input");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Line Input", "");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
||||
|
||||
prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "console_info");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Line Info", "");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
||||
|
||||
prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "console_error");
|
||||
RNA_def_property_array(prop, 3);
|
||||
RNA_def_property_ui_text(prop, "Line Error", "");
|
||||
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
||||
}
|
||||
|
||||
static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@ -1562,6 +1600,12 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
|
||||
RNA_def_property_struct_type(prop, "ThemeUserPreferences");
|
||||
RNA_def_property_ui_text(prop, "User Preferences", "");
|
||||
|
||||
prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
|
||||
RNA_def_property_struct_type(prop, "ThemeConsole");
|
||||
RNA_def_property_ui_text(prop, "Console", "");
|
||||
|
||||
prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
||||
@ -1590,6 +1634,7 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna)
|
||||
rna_def_userdef_theme_space_outliner(brna);
|
||||
rna_def_userdef_theme_space_info(brna);
|
||||
rna_def_userdef_theme_space_userpref(brna);
|
||||
rna_def_userdef_theme_space_console(brna);
|
||||
rna_def_userdef_theme_space_sound(brna);
|
||||
rna_def_userdef_theme_space_logic(brna);
|
||||
rna_def_userdef_theme_colorset(brna);
|
||||
|
Loading…
Reference in New Issue
Block a user