diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-24 01:55:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-24 01:55:11 +0400 |
commit | 327b17b26f6afd7658fe5de0ca9f8bb0c2429f21 (patch) | |
tree | 67fda0ec72e86ee3df6910e178d72a3783b5f86f /source/blender/makesrna/intern/rna_ui_api.c | |
parent | 555ae1f4b0476c6ce4f72974f7f829b31e6704d2 (diff) |
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 22 |
1 files changed, 11 insertions, 11 deletions
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; |