Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-25 11:21:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-25 11:21:55 +0300
commita5bbfd9fcaaf8f314ba96bade208ca0c66091ac1 (patch)
treed22a60dee1371fbb5845e5e908db3472a4d21ab0 /source/blender/makesrna/intern/rna_ui_api.c
parent2fa0a9a329154107302090fbe5b04102c5701236 (diff)
UI: add icon_only option to prop_popover_enum
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c4
1 files changed, 4 insertions, 0 deletions
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);