Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-10-02 20:04:38 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-10-08 20:46:00 +0300
commitcf8e71db615c2d74bf87f18ab8389a675cbe6c51 (patch)
tree9f29f386985d521b4e28d644e4cd6e6d7e53015d /source/blender/editors/interface/resources.c
parent2ac65f6153a2da2df7cda908689bb7c1865f088d (diff)
UI: add icon color coding for different data types in the outliner.
For now we have categories collection, object, object data, modifiers & constraints, and shading. The icons can be categorized by adding e.g. DEF_ICON_OBJECT() in UI_icons.h. Light themes will need to be updated to use darker colors to keep icons visible in the outliner.
Diffstat (limited to 'source/blender/editors/interface/resources.c')
-rw-r--r--source/blender/editors/interface/resources.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index fbbaa544e2c..33a8a2ec5fa 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -686,6 +686,17 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
case TH_GIZMO_B:
cp = btheme->tui.gizmo_b; break;
+ case TH_ICON_COLLECTION:
+ cp = btheme->tui.icon_collection; break;
+ case TH_ICON_OBJECT:
+ cp = btheme->tui.icon_object; break;
+ case TH_ICON_OBJECT_DATA:
+ cp = btheme->tui.icon_object_data; break;
+ case TH_ICON_MODIFIER:
+ cp = btheme->tui.icon_modifier; break;
+ case TH_ICON_SHADING:
+ cp = btheme->tui.icon_shading; break;
+
case TH_INFO_SELECTED:
cp = ts->info_selected;
break;
@@ -1109,6 +1120,31 @@ void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4])
col[3] = cp[3];
}
+bool UI_GetIconThemeColor4fv(int colorid, float col[4])
+{
+ if (colorid == 0) {
+ return false;
+ }
+
+ /* Only colored icons in outliner and popups, overall UI is intended
+ * to stay monochrome and out of the way except a few places where it
+ * is important to communicate different data types. */
+ if (!((theme_spacetype == SPACE_OUTLINER) ||
+ (theme_regionid == RGN_TYPE_TEMPORARY)))
+ {
+ return false;
+ }
+
+ const unsigned char *cp;
+ cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
+ col[0] = ((float)cp[0]) / 255.0f;
+ col[1] = ((float)cp[1]) / 255.0f;
+ col[2] = ((float)cp[2]) / 255.0f;
+ col[3] = ((float)cp[3]) / 255.0f;
+
+ return true;
+}
+
void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], int offset)
{
int r, g, b;