From 937d89afba36ea0f22ad929d2c8bdf8a853dc7d8 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 29 Jun 2020 17:19:43 +0200 Subject: UI: Show library status icons in search menus, rather than letter prefix Rather than a `L` (linked), `O` (overridden) or `M` (missing) prefix for the name, show the existing library status icons. See D7999 for screenshots. Note that when using preview icons, or if the search menu contains items with own icons (e.g. brush icons), we still fallback to the prefix solution. Zero or fake user is still indicated with a prefix. Differential Revision: https://developer.blender.org/D7999 Reviewed by: Bastien Montagne, William Reynish --- .../blender/editors/space_outliner/outliner_draw.c | 32 ++++------------------ 1 file changed, 6 insertions(+), 26 deletions(-) (limited to '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 7009d416e91..2dd0d9477de 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -3108,33 +3108,13 @@ static void outliner_draw_tree_element(bContext *C, offsx += 2 * ufac; } - if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_LINKED(tselem->id)) { - if (tselem->id->tag & LIB_TAG_MISSING) { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_BROKEN, - alpha_fac); - } - else if (tselem->id->tag & LIB_TAG_INDIRECT) { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_INDIRECT, - alpha_fac); + if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION)) { + const BIFIconID lib_icon = UI_library_icon_get(tselem->id); + if (lib_icon != ICON_NONE) { + UI_icon_draw_alpha( + (float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, lib_icon, alpha_fac); + offsx += UI_UNIT_X + 4 * ufac; } - else { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_DIRECT, - alpha_fac); - } - offsx += UI_UNIT_X + 4 * ufac; - } - else if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_OVERRIDE_LIBRARY(tselem->id)) { - UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, - (float)*starty + 2 * ufac, - ICON_LIBRARY_DATA_OVERRIDE, - alpha_fac); - offsx += UI_UNIT_X + 4 * ufac; } GPU_blend(false); -- cgit v1.2.3