diff options
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_api.c | 15 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_api.c b/source/blender/editors/interface/interface_api.c index b4e7dc03506..7b2cdbe32dd 100644 --- a/source/blender/editors/interface/interface_api.c +++ b/source/blender/editors/interface/interface_api.c @@ -33,11 +33,24 @@ #include "RNA_types.h" #include "UI_interface.h" +#include "UI_resources.h" + +#define DEF_ICON(name) {name, #name, #name, ""}, +static EnumPropertyItem icon_items[] = { +#include "UI_icons.h" + {0, NULL, NULL, NULL}}; +#undef DEF_ICON static void api_ui_item_common(FunctionRNA *func) { + PropertyRNA *prop; + RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item."); - RNA_def_int(func, "icon", 0, 0, INT_MAX, "", "Override automatic icon of the item.", 0, INT_MAX); + + prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, icon_items); + RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item."); + } static void api_ui_item_op_common(FunctionRNA *func) diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1cb58c986d0..edf2f160285 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -75,7 +75,7 @@ static int theme_regionid= RGN_TYPE_WINDOW; void ui_resources_init(void) { - UI_icons_init(BIFICONID_LAST+1); + UI_icons_init(BIFICONID_LAST); } void ui_resources_free(void) |