From 327b17b26f6afd7658fe5de0ca9f8bb0c2429f21 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 23 Jan 2013 21:55:11 +0000 Subject: Fix #31338: python enum properties can now specify icons for items, in the following order: (identifier, name, description, icon, unique number) This also works without the icon still, for compatibility. --- source/blender/makesrna/intern/rna_ui_api.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/blender/makesrna/intern/rna_ui_api.c') diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 22a9ec72f0f..787a5d6487e 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -42,6 +42,17 @@ #include "rna_internal.h" +#define DEF_ICON_BLANK_SKIP +#define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""}, +#define DEF_VICO(name) {VICO_##name, (#name), 0, (#name), ""}, +EnumPropertyItem icon_items[] = { +#include "UI_icons.h" + {0, NULL, 0, NULL, NULL} +}; +#undef DEF_ICON_BLANK_SKIP +#undef DEF_ICON +#undef DEF_VICO + #ifdef RNA_RUNTIME static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon, @@ -181,17 +192,6 @@ static int rna_ui_get_enum_icon(bContext *C, PointerRNA *ptr, const char *propna #else -#define DEF_ICON_BLANK_SKIP -#define DEF_ICON(name) {ICON_##name, (#name), 0, (#name), ""}, -#define DEF_VICO(name) {VICO_##name, (#name), 0, (#name), ""}, -EnumPropertyItem icon_items[] = { -#include "UI_icons.h" - {0, NULL, 0, NULL, NULL} -}; -#undef DEF_ICON_BLANK_SKIP -#undef DEF_ICON -#undef DEF_VICO - static void api_ui_item_common(FunctionRNA *func) { PropertyRNA *prop; -- cgit v1.2.3