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.
This commit is contained in:
Brecht Van Lommel 2019-05-09 17:07:06 +02:00
parent 930ae8e3c4
commit 9b924d73da
10 changed files with 30 additions and 6 deletions

@ -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),

@ -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"

@ -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")

@ -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;
}

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

@ -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,

@ -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},

@ -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;

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

@ -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);