diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 03:33:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 03:33:08 +0300 |
commit | 756be8f4d8ff2ba3915b67c36c2e40f1652397da (patch) | |
tree | 7bc894c0303bdf64eccd21fef8a0211e1ac9b350 /source/blender/editors/interface/interface_layout.c | |
parent | a91886e76ebd16afe07564713f73c340c940125e (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/editors/interface/interface_layout.c')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 9e9c244cfaf..afcbcbbdf52 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2263,10 +2263,7 @@ static uiBut *ui_item_menu( void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon) { - MenuType *mt; - - mt = WM_menutype_find(menuname, false); - + MenuType *mt = WM_menutype_find(menuname, false); if (mt == NULL) { RNA_warning("not found %s", menuname); return; @@ -2284,6 +2281,19 @@ void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon) mt->description ? TIP_(mt->description) : "", false); } +void uiItemMContents(uiLayout *layout, const char *menuname) +{ + MenuType *mt = WM_menutype_find(menuname, false); + if (mt == NULL) { + RNA_warning("not found %s", menuname); + return; + } + + uiBlock *block = layout->root->block; + bContext *C = block->evil_C; + UI_menutype_draw(C, mt, layout); +} + /* popover */ void uiItemPopoverPanel_ptr(uiLayout *layout, bContext *C, PanelType *pt, const char *name, int icon) { |