diff options
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index ff84c3c9d88..9e805e2052f 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2769,43 +2769,38 @@ static void tselem_draw_icon(uiBlock *block, const bool is_clickable) { TreeElementIcon data = tree_element_get_icon(tselem, te); - if (data.icon == 0) { return; } - if (outliner_is_collection_tree_element(te)) { - Collection *collection = outliner_collection_from_tree_element(te); + const bool is_collection = outliner_is_collection_tree_element(te); + /* Collection colors and icons covered by restrict buttons. */ + if (!is_clickable || x >= xmax || is_collection) { /* 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_tag != 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_tag].color, - true); - } - else { - UI_icon_draw_ex(x, y, data.icon, U.inv_dpi_fac, alpha, 0.0f, NULL, true); + + if (is_collection) { + Collection *collection = outliner_collection_from_tree_element(te); + if (collection->color_tag != 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_tag].color, + true); + return; + } } - } - /* Icon is covered by restrict buttons */ - else if (!is_clickable || x >= xmax) { + /* 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; - /* restrict column clip... it has been coded by simply overdrawing, * doesn't work for buttons */ uchar color[4]; |