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>2018-12-20 03:33:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-20 03:33:08 +0300
commit756be8f4d8ff2ba3915b67c36c2e40f1652397da (patch)
tree7bc894c0303bdf64eccd21fef8a0211e1ac9b350 /source/blender/makesrna/intern/rna_ui_api.c
parenta91886e76ebd16afe07564713f73c340c940125e (diff)
UI: add method to draw menu contents
This supports expanding menu contents into an existing layout. Needed to fix T58937.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 4d361920dcb..fdf2b5f311b 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -294,6 +294,12 @@ static void rna_uiItemM(
uiItemM(layout, menuname, name, icon);
}
+static void rna_uiItemM_contents(
+ uiLayout *layout, const char *menuname)
+{
+ uiItemMContents(layout, menuname);
+}
+
static void rna_uiItemPopoverPanel(
uiLayout *layout, bContext *C,
const char *panel_type, const char *name, const char *text_ctxt,
@@ -741,6 +747,10 @@ void RNA_api_ui_layout(StructRNA *srna)
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");
+ func = RNA_def_function(srna, "menu_contents", "rna_uiItemM_contents");
+ parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+
func = RNA_def_function(srna, "popover", "rna_uiItemPopoverPanel");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm = RNA_def_string(func, "panel", NULL, 0, "", "Identifier of the panel");