[Bf-blender-cvs] [9b924d73da9] master: Themes: add scene icon color category, for consistency in properties tab bar

Brecht Van Lommel noreply at git.blender.org
Thu May 9 19:55:44 CEST 2019


Commit: 9b924d73da90526f5caf31b01dfd34156337f075
Author: Brecht Van Lommel
Date:   Thu May 9 17:07:06 2019 +0200
Branches: master
https://developer.blender.org/rB9b924d73da90526f5caf31b01dfd34156337f075

Themes: add scene icon color category, for consistency in properties tab bar

The icons here still need to be dimmed when the tab is inactive.

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

M	release/datafiles/userdef/userdef_default_theme.c
M	release/scripts/presets/interface_theme/blender_light.xml
M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/include/UI_icons.h
M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/interface/interface_icons.c
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/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index ec0b49c2d65..c13e31c9092 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -248,6 +248,7 @@ const bTheme U_theme_default = {
     .gizmo_secondary = RGBA(0x63ffffff),
     .gizmo_a = RGBA(0x4da84dff),
     .gizmo_b = RGBA(0xa33535ff),
+    .icon_scene = RGBA(0xe6e6e6ff),
     .icon_collection = RGBA(0xe6e6e6ff),
     .icon_object = RGBA(0xe49759ff),
     .icon_object_data = RGBA(0x89e689ff),
diff --git a/release/scripts/presets/interface_theme/blender_light.xml b/release/scripts/presets/interface_theme/blender_light.xml
index d1fc068853f..0420092c3a8 100644
--- a/release/scripts/presets/interface_theme/blender_light.xml
+++ b/release/scripts/presets/interface_theme/blender_light.xml
@@ -16,6 +16,7 @@
         gizmo_secondary="#63ffff"
         gizmo_a="#4da84d"
         gizmo_b="#a33535"
+        icon_scene="#000000ff"
         icon_collection="#000000ff"
         icon_object="#000000ff"
         icon_object_data="#000000ff"
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index a14ffc33034..6db31775257 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -889,6 +889,7 @@ class USERPREF_PT_theme_interface_icons(PreferencePanel, Panel):
 
         flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
 
+        flow.prop(ui, "icon_scene")
         flow.prop(ui, "icon_collection")
         flow.prop(ui, "icon_object")
         flow.prop(ui, "icon_object_data")
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index b3e437e39de..6ac0e8f2c74 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -118,6 +118,8 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme)
    * Include next version bump.
    */
   {
+    FROM_DEFAULT_V4_UCHAR(tui.icon_scene);
+
     if (btheme->space_view3d.obcenter_dia == 0) {
       btheme->space_view3d.obcenter_dia = U_theme_default.space_view3d.obcenter_dia;
     }
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index c68f47da447..9ee9e952856 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -24,6 +24,9 @@
 /* Note: this is included multiple times with different #defines for DEF_ICON. */
 
 /* Auto define more specific types for places that do not need the distinction. */
+#ifndef DEF_ICON_SCENE
+#  define DEF_ICON_SCENE DEF_ICON
+#endif
 #ifndef DEF_ICON_COLLECTION
 #  define DEF_ICON_COLLECTION DEF_ICON
 #endif
@@ -133,8 +136,8 @@ DEF_ICON_SHADING(MATERIAL)
 DEF_ICON_SHADING(TEXTURE)
 DEF_ICON(ANIM)
 DEF_ICON_SHADING(WORLD)
-DEF_ICON(SCENE)
-DEF_ICON(OUTPUT)
+DEF_ICON_SCENE(SCENE)
+DEF_ICON_SCENE(OUTPUT)
 DEF_ICON_BLANK(145)
 DEF_ICON_BLANK(146)
 DEF_ICON(SCRIPT)
@@ -142,7 +145,7 @@ DEF_ICON_MODIFIER(PARTICLES)
 DEF_ICON_MODIFIER(PHYSICS)
 DEF_ICON_OBJECT_DATA(SPEAKER)
 DEF_ICON_BLANK(151)
-DEF_ICON(TOOL_SETTINGS)
+DEF_ICON_SCENE(TOOL_SETTINGS)
 DEF_ICON_MODIFIER(SHADERFX)
 DEF_ICON_MODIFIER(MODIFIER)
 DEF_ICON_BLANK(155)
@@ -211,8 +214,8 @@ DEF_ICON(TRACKING_REFINE_FORWARDS)
 DEF_ICON_BLANK(77b)
 
 /* DATA */
-DEF_ICON(SCENE_DATA)
-DEF_ICON(RENDERLAYERS)
+DEF_ICON_SCENE(SCENE_DATA)
+DEF_ICON_SCENE(RENDERLAYERS)
 DEF_ICON_SHADING(WORLD_DATA)
 DEF_ICON_OBJECT(OBJECT_DATA)
 DEF_ICON_OBJECT_DATA(MESH_DATA)
@@ -244,7 +247,7 @@ DEF_ICON_SHADING(IMAGE_DATA)
 DEF_ICON(FILE)
 DEF_ICON(FCURVE)
 DEF_ICON_OBJECT_DATA(FONT_DATA)
-DEF_ICON(RENDER_RESULT)
+DEF_ICON_SCENE(RENDER_RESULT)
 DEF_ICON_OBJECT_DATA(SURFACE_DATA)
 DEF_ICON_OBJECT_DATA(EMPTY_DATA)
 DEF_ICON(PRESET)
@@ -1022,6 +1025,7 @@ DEF_ICON_COLOR(EVENT_RETURN)
 
 #undef DEF_ICON
 #undef DEF_ICON_ERROR
+#undef DEF_ICON_SCENE
 #undef DEF_ICON_COLLECTION
 #undef DEF_ICON_OBJECT
 #undef DEF_ICON_OBJECT_DATA
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 0c2090b2c91..404dfe3c177 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -262,6 +262,7 @@ typedef enum ThemeColorID {
   TH_ANIM_INACTIVE,      /* no active action */
   TH_ANIM_PREVIEW_RANGE, /* preview range overlay */
 
+  TH_ICON_SCENE,
   TH_ICON_COLLECTION,
   TH_ICON_OBJECT,
   TH_ICON_OBJECT_DATA,
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index eeca9151224..4cfc942d3f5 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -160,6 +160,7 @@ static IconTexture icongltex = {0, 0, 0, 0.0f, 0.0f};
 
 static const IconType icontypes[] = {
 #  define DEF_ICON(name) {ICON_TYPE_MONO_TEXTURE, 0},
+#  define DEF_ICON_SCENE(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_SCENE},
 #  define DEF_ICON_COLLECTION(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_COLLECTION},
 #  define DEF_ICON_OBJECT(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_OBJECT},
 #  define DEF_ICON_OBJECT_DATA(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_OBJECT_DATA},
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 41d0fda74ee..86806946db0 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -868,6 +868,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
           cp = btheme->tui.gizmo_b;
           break;
 
+        case TH_ICON_SCENE:
+          cp = btheme->tui.icon_scene;
+          break;
         case TH_ICON_COLLECTION:
           cp = btheme->tui.icon_collection;
           break;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index ad20597a2b2..e47064b31b8 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -184,6 +184,8 @@ typedef struct ThemeUI {
   char gizmo_b[4];
 
   /* Icon Colors. */
+  /** Scene items. */
+  char icon_scene[4];
   /** Collection items. */
   char icon_collection[4];
   /** Object items. */
@@ -194,6 +196,8 @@ typedef struct ThemeUI {
   char icon_modifier[4];
   /** Shading related items. */
   char icon_shading[4];
+
+  char _pad1[4];
 } ThemeUI;
 
 /* try to put them all in one, if needed a special struct can be created as well
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 6cea367c241..6ece3cea529 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1377,6 +1377,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
   RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
 
   /* Icon colors. */
+  prop = RNA_def_property(srna, "icon_scene", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_float_sdna(prop, NULL, "icon_scene");
+  RNA_def_property_array(prop, 4);
+  RNA_def_property_ui_text(prop, "Scene", "");
+  RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
   prop = RNA_def_property(srna, "icon_collection", PROP_FLOAT, PROP_COLOR_GAMMA);
   RNA_def_property_float_sdna(prop, NULL, "icon_collection");
   RNA_def_property_array(prop, 4);



More information about the Bf-blender-cvs mailing list