From 4c3813fb32567805ef6eac708e3602c2d367cc58 Mon Sep 17 00:00:00 2001 From: Nathan Craddock Date: Tue, 15 Sep 2020 12:22:03 -0600 Subject: UI: Show color tagged collection icons in menus Draw color tagged collection icons in the link to collection, add collection instance, collection instance search, and remove collection menus. Manifest Task: https://developer.blender.org/T77777 Differential Revision: https://developer.blender.org/D8622 --- source/blender/windowmanager/intern/wm_operators.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index ffe2ffac3a2..0f3409af3d3 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3991,6 +3991,12 @@ static const EnumPropertyItem *rna_id_itemf(bContext *UNUSED(C), if (local == false || !ID_IS_LINKED(id)) { item_tmp.identifier = item_tmp.name = id->name + 2; item_tmp.value = i++; + + /* Show collection color tag icons in menus. */ + if (GS(id->name) == ID_GR) { + item_tmp.icon = UI_collection_color_icon_get((Collection *)id); + } + RNA_enum_item_add(&item, &totitem, &item_tmp); } } -- cgit v1.2.3