UI: Add theming support for the status-bar

For now not bumping subversion, even though I technically should. We can do if
needed, but would like to avoid bumping it every few days...
This commit is contained in:
Julian Eisel 2018-05-24 10:19:27 +02:00
parent 3820237ddb
commit 2d05f91bea
Notes: blender-bot 2023-02-14 07:31:32 +01:00
Referenced by issue #55175, Outliner - "Show Active" does not work
Referenced by issue #55176, Multiresolution Modifier Crash
3 changed files with 35 additions and 0 deletions

View File

@ -165,6 +165,9 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
case SPACE_TOPBAR:
ts = &btheme->ttopbar;
break;
case SPACE_STATUSBAR:
ts = &btheme->tstatusbar;
break;
default:
ts = &btheme->tv3d;
break;
@ -1238,6 +1241,9 @@ void ui_theme_init_default(void)
copy_v4_v4_char(tmp, btheme->ttopbar.header);
copy_v4_v4_char(btheme->ttopbar.header, btheme->ttopbar.tab_inactive);
copy_v4_v4_char(btheme->ttopbar.back, tmp);
/* space statusbar */
btheme->tstatusbar = btheme->tv3d;
}
void ui_style_init_default(void)
@ -3001,6 +3007,12 @@ void init_userdef_do_versions(void)
}
}
if (!USER_VERSION_ATLEAST(280, 16)) {
for (bTheme *btheme = U.themes.first; btheme; btheme = btheme->next) {
btheme->tstatusbar = btheme->tv3d;
}
}
/**
* Include next version bump.
*/

View File

@ -406,6 +406,7 @@ typedef struct bTheme {
ThemeSpace tconsole;
ThemeSpace tclip;
ThemeSpace ttopbar;
ThemeSpace tstatusbar;
/* 20 sets of bone colors for this theme */
ThemeWireColor tarm[20];

View File

@ -2962,6 +2962,20 @@ static void rna_def_userdef_theme_space_topbar(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna);
}
static void rna_def_userdef_theme_space_statusbar(BlenderRNA *brna)
{
StructRNA *srna;
/* space_statusbar */
srna = RNA_def_struct(brna, "ThemeStatusBar", NULL);
RNA_def_struct_sdna(srna, "ThemeSpace");
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Theme Status Bar", "Theme settings for the Status Bar");
rna_def_userdef_theme_spaces_main(srna);
}
static void rna_def_userdef_themes(BlenderRNA *brna)
{
StructRNA *srna;
@ -2987,6 +3001,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
{17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
{20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
{21, "TOPBAR", ICON_NONE, "Top Bar", ""},
{22, "STATUSBAR", ICON_NONE, "Status Bar", ""},
{0, NULL, 0, NULL, NULL}
};
@ -3114,6 +3129,12 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "ttopbar");
RNA_def_property_struct_type(prop, "ThemeTopBar");
RNA_def_property_ui_text(prop, "Top Bar", "");
prop = RNA_def_property(srna, "statusbar", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "tstatusbar");
RNA_def_property_struct_type(prop, "ThemeStatusBar");
RNA_def_property_ui_text(prop, "Status Bar", "");
}
static void rna_def_userdef_addon(BlenderRNA *brna)
@ -3204,6 +3225,7 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna)
rna_def_userdef_theme_space_console(brna);
rna_def_userdef_theme_space_clip(brna);
rna_def_userdef_theme_space_topbar(brna);
rna_def_userdef_theme_space_statusbar(brna);
rna_def_userdef_theme_colorset(brna);
rna_def_userdef_themes(brna);
}