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:
authorNathan Craddock <nzcraddock@gmail.com>2020-07-04 20:37:40 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-07-04 20:37:40 +0300
commitf5a22d4bbdd833ecc31f6d22d7faafda616cafda (patch)
tree2a4318e0daffbeb3725b2906750ab926133dd4f2 /source/blender/editors/space_outliner/outliner_draw.c
parent680b2a4901e16165adc67d44342370443870cc36 (diff)
Collection Colors: Color collection icons
Color the collection icons rather than drawing behind.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index af9263048ab..4378afcca54 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2783,8 +2783,33 @@ static void tselem_draw_icon(uiBlock *block,
return;
}
+ if (outliner_is_collection_tree_element(te)) {
+ Collection *collection = outliner_collection_from_tree_element(te);
+
+ /* Reduce alpha to match icon buttons */
+ alpha *= 0.8f;
+
+ /* placement of icons, copied from interface_widgets.c */
+ float aspect = (0.8f * UI_UNIT_Y) / ICON_DEFAULT_HEIGHT;
+ x += 2.0f * aspect;
+ y += 2.0f * aspect;
+ if (collection->color != COLLECTION_COLOR_NONE) {
+ bTheme *btheme = UI_GetTheme();
+ UI_icon_draw_ex(x,
+ y,
+ data.icon,
+ U.inv_dpi_fac,
+ alpha,
+ 0.0f,
+ btheme->collection_color[collection->color - 1].color,
+ true);
+ }
+ else {
+ UI_icon_draw_ex(x, y, data.icon, U.inv_dpi_fac, alpha, 0.0f, NULL, true);
+ }
+ }
/* Icon is covered by restrict buttons */
- if (!is_clickable || x >= xmax) {
+ else if (!is_clickable || x >= xmax) {
/* Reduce alpha to match icon buttons */
alpha *= 0.8f;