diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-09 18:07:06 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-09 20:55:10 +0300 |
commit | 9b924d73da90526f5caf31b01dfd34156337f075 (patch) | |
tree | c5d193baaef3cdc3e9f5dc6933aebb11be057a7c /source | |
parent | 930ae8e3c422f6c875ae933480dc4a4a9b2c2c51 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 2 | ||||
-rw-r--r-- | source/blender/editors/include/UI_icons.h | 16 | ||||
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 6 |
7 files changed, 27 insertions, 6 deletions
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); |