[Bf-blender-cvs] [cc3ae5415ad] topbar: Show theme options for tags in UserPrefs

Julian Eisel noreply at git.blender.org
Tue Aug 1 14:06:19 CEST 2017


Commit: cc3ae5415ad2efd421fa8ee853a5476cc798763e
Author: Julian Eisel
Date:   Tue Aug 1 14:04:39 2017 +0200
Branches: topbar
https://developer.blender.org/rBcc3ae5415ad2efd421fa8ee853a5476cc798763e

Show theme options for tags in UserPrefs

Also fix buffer out-of-range access and default color of tab outline.

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/interface/resources.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 25d0e430708..0abd593f4ad 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -844,6 +844,9 @@ class USERPREF_PT_theme(Panel):
             col.label(text="List Item:")
             self._theme_widget_style(col, ui.wcol_list_item)
 
+            col.label(text="Tab:")
+            self._theme_widget_style(col, ui.wcol_tab)
+
             ui_state = theme.user_interface.wcol_state
             col.label(text="State:")
 
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index bf22d428b17..f6c75087085 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1920,7 +1920,7 @@ static struct uiWidgetColors wcol_list_item = {
 };
 
 struct uiWidgetColors wcol_tab = {
-	{255, 255, 255, 255},
+	{60, 60, 60, 255},
 	{83, 83, 83, 255},
 	{114, 114, 114, 255},
 	{90, 90, 90, 255},
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 130868e5ff9..9c7318aea30 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1213,7 +1213,7 @@ void ui_theme_init_default(void)
 	ui_theme_space_init_handles_color(&btheme->tclip);
 
 	/* space topbar */
-	char tmp[3];
+	char tmp[4];
 	btheme->ttopbar = btheme->tv3d;
 	/* swap colors */
 	copy_v4_v4_char(tmp, btheme->ttopbar.header);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 5b2278e008c..6e6224c17b2 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -82,6 +82,7 @@ EnumPropertyItem rna_enum_space_type_items[] = {
 	{SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available data-blocks"},
 	{SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", "Edit persistent configuration settings"},
 	{SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages (drag down to expand and display)"},
+	/* TODO: topbar shouldn't be selectable through menu. */
 	{SPACE_TOPBAR, "TOPBAR", ICON_NONE, "Top Bar", "Global bar at the top of the screen for global per-window settings"},
 	{0, "", ICON_NONE, NULL, NULL},
 	{SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", "Browse for files and assets"},
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 5a2cfc612d5..0ae3064a44d 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1031,6 +1031,11 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "State Colors", "");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
 
+	prop = RNA_def_property(srna, "wcol_tab", PROP_POINTER, PROP_NONE);
+	RNA_def_property_flag(prop, PROP_NEVER_NULL);
+	RNA_def_property_ui_text(prop, "Tab Colors", "");
+	RNA_def_property_update(prop, 0, "rna_userdef_update");
+
 	prop = RNA_def_property(srna, "menu_shadow_fac", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_ui_text(prop, "Menu Shadow Strength", "Blending factor for menu shadows");
 	RNA_def_property_range(prop, 0.01f, 1.0f);




More information about the Bf-blender-cvs mailing list