diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-11-17 16:59:25 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-11-17 16:59:25 +0300 |
commit | 97a50e78ca88b4ffe180bc6567e5ed0358239efe (patch) | |
tree | ffab68b5257d81b5fd7bc9aad6bdb6922e58c0c9 /source/blender/makesrna/intern/rna_ui_api.c | |
parent | 8f4d98283d3a4d6e23e9024e95974486015170d1 (diff) | |
parent | 80d1d624d378d4d8c03fb26ef286baf5479b6497 (diff) |
Merge branch 'master' into alembic_pointcache
Conflicts:
CMakeLists.txt
source/blender/blenkernel/intern/rigidbody.c
source/blender/makesrna/intern/rna_object_force.c
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index b13bdedaffd..33c35313b38 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -178,7 +178,7 @@ static void rna_uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const c } static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, const char *text_ctxt, - int translate, int icon, int emboss) + int translate, int icon, int emboss, int icon_value) { wmOperatorType *ot; int flag; @@ -192,6 +192,10 @@ static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char * /* Get translated name (label). */ name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate); + if (icon_value && !icon) { + icon = icon_value; + } + flag = UI_ITEM_O_RETURN_PROPS; flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG; @@ -551,6 +555,10 @@ void RNA_api_ui_layout(StructRNA *srna) func = RNA_def_function(srna, "operator", "rna_uiItemO"); api_ui_item_op_common(func); RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, just the icon/text"); + parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED); + RNA_def_property_ui_text(parm, "Icon Value", + "Override automatic icon of the item " + "(use it e.g. with custom material icons returned by icon()...)"); parm = RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR); |