Commit: 2d05f91bea9a566c62a298243025a561b318c46b
Author: Julian Eisel
Date:   Thu May 24 10:19:27 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB2d05f91bea9a566c62a298243025a561b318c46b

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...

===================================================================

M       source/blender/editors/interface/resources.c
M       source/blender/makesdna/DNA_userdef_types.h
M       source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/source/blender/editors/interface/resources.c 
b/source/blender/editors/interface/resources.c
index acfae0a6f0a..979a2164199 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -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.
         */
diff --git a/source/blender/makesdna/DNA_userdef_types.h 
b/source/blender/makesdna/DNA_userdef_types.h
index 326d42d9cb3..9817d44c96b 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -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];
diff --git a/source/blender/makesrna/intern/rna_userdef.c 
b/source/blender/makesrna/intern/rna_userdef.c
index 741a1a87eb1..fef4cc3ed8e 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -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);
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to