From a5bbfd9fcaaf8f314ba96bade208ca0c66091ac1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Mar 2019 19:21:55 +1100 Subject: UI: add icon_only option to prop_popover_enum --- source/blender/makesrna/intern/rna_ui_api.c | 4 ++++ 1 file changed, 4 insertions(+) (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 afcff93738a..4abdbca10b8 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -136,6 +136,7 @@ static void rna_uiItemMenuEnumR( static void rna_uiItemPopoverPanelEnumR( uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, const char *text_ctxt, bool translate, int icon, + bool icon_only, const char *panel_type) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); @@ -150,6 +151,8 @@ static void rna_uiItemPopoverPanelEnumR( } int flag = 0; + flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0; + /* Get translated name (label). */ name = rna_translate_ui_text(name, text_ctxt, NULL, prop, translate); uiItemFullR_with_popover(layout, ptr, prop, -1, 0, flag, name, icon, panel_type); @@ -664,6 +667,7 @@ void RNA_api_ui_layout(StructRNA *srna) func = RNA_def_function(srna, "prop_popover_enum", "rna_uiItemPopoverPanelEnumR"); api_ui_item_rna_common(func); api_ui_item_common(func); + RNA_def_boolean(func, "icon_only", false, "", "Draw only icons in tabs, no text"); parm = RNA_def_string(func, "panel", NULL, 0, "", "Identifier of the panel"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); -- cgit v1.2.3