Commit: 16f625ee654065f3102630c81bb0aca9df1465c2 Author: Nathan Craddock Date: Tue Sep 15 12:34:57 2020 -0600 Branches: master https://developer.blender.org/rB16f625ee654065f3102630c81bb0aca9df1465c2
Outliner: Draw colored collection icons This replaces the collection icon with the filled collection icon. If the collection is color tagged, then the icon draws in the tagged color. Manifest Task: https://developer.blender.org/T77777 Differential Revision: https://developer.blender.org/D8622 =================================================================== M source/blender/editors/space_outliner/outliner_draw.c =================================================================== diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 3de786ddd4d..32b29e712bc 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2464,7 +2464,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) data.drag_parent = (data.drag_id && te->parent) ? TREESTORE(te->parent)->id : NULL; } - data.icon = ICON_GROUP; + data.icon = ICON_OUTLINER_COLLECTION; break; } case TSE_GP_LAYER: { @@ -2769,8 +2769,30 @@ static void tselem_draw_icon(uiBlock *block, return; } + if (outliner_is_collection_tree_element(te)) { + Collection *collection = outliner_collection_from_tree_element(te); + + /* 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); + } + } /* 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; _______________________________________________ Bf-blender-cvs mailing list [email protected] https://lists.blender.org/mailman/listinfo/bf-blender-cvs
