From 1e1d1f15e8750642c29e4d04e09462cc4e4d2baa Mon Sep 17 00:00:00 2001 From: Ethan Hall Date: Wed, 2 Mar 2022 15:33:48 +0100 Subject: UI: Enable the outliner to use the correct icon for each curve subtype This patch enables enables the outliner to use the correct icon for each of the curve subtypes (Curve/Surface/Font). Differential Revision: https://developer.blender.org/D14093 Reviewed by: Julian Eisel --- .../blender/editors/space_outliner/outliner_draw.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 2da416c8671..423f11e0641 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -28,6 +28,7 @@ #include "BKE_armature.h" #include "BKE_context.h" +#include "BKE_curve.h" #include "BKE_deform.h" #include "BKE_gpencil.h" #include "BKE_idtype.h" @@ -2655,9 +2656,23 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) case ID_ME: data.icon = ICON_OUTLINER_DATA_MESH; break; - case ID_CU_LEGACY: - data.icon = ICON_OUTLINER_DATA_CURVE; + case ID_CU_LEGACY: { + const Curve *cu = (Curve *)tselem->id; + const short obtype = BKE_curve_type_get(cu); + + switch (obtype) { + case OB_FONT: + data.icon = ICON_OUTLINER_DATA_FONT; + break; + case OB_SURF: + data.icon = ICON_OUTLINER_DATA_SURFACE; + break; + default: + data.icon = ICON_OUTLINER_DATA_CURVE; + break; + } break; + } case ID_MB: data.icon = ICON_OUTLINER_DATA_META; break; -- cgit v1.2.3