[Bf-blender-cvs] [1b285bc43b6] soc-2020-outliner: Collections: Add color tags to move and link menus

Nathan Craddock noreply at git.blender.org
Sat Aug 8 06:28:35 CEST 2020


Commit: 1b285bc43b6f0d0d8a1f11d74ed97ea2a1c2aabe
Author: Nathan Craddock
Date:   Fri Aug 7 22:28:13 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB1b285bc43b6f0d0d8a1f11d74ed97ea2a1c2aabe

Collections: Add color tags to move and link menus

===================================================================

M	source/blender/editors/object/object_edit.c

===================================================================

diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 04113f70e52..10b5afca3df 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1785,12 +1785,23 @@ static void move_to_collection_menu_create(bContext *UNUSED(C), uiLayout *layout
   }
 }
 
+static int collection_color_to_icon(Collection *collection)
+{
+  int icon = ICON_NONE;
+
+  if (collection->color != COLLECTION_COLOR_NONE) {
+    icon = ICON_COLLECTION_COLOR_01 + (collection->color - 1);
+  }
+
+  return icon;
+}
+
 static void move_to_collection_menus_items(uiLayout *layout, MoveToCollectionData *menu)
 {
   if (BLI_listbase_is_empty(&menu->submenus)) {
     uiItemIntO(layout,
                menu->collection->id.name + 2,
-               ICON_NONE,
+               collection_color_to_icon(menu->collection),
                menu->ot->idname,
                "collection_index",
                menu->index);



More information about the Bf-blender-cvs mailing list