diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 03:42:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 03:42:19 +0300 |
commit | 56754226deb0433654ec1a866c756b60ea176dd5 (patch) | |
tree | c2a38b6dab94ec7377640b1c269d92c7494d2fa1 /source | |
parent | 06e9d1683b76fa6c236f589671121c752e5cb374 (diff) | |
parent | 1195a4a040ba8ecffd3221f5aa38c7be5272124b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_context_menu.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_query.c | 8 |
3 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index 240649c8ab0..d00ab70562c 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -715,7 +715,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) } /* Show header tools for header buttons. */ - if (ui_block_is_menu(but->block) == false) { + if (ui_block_is_popup_any(but->block) == false) { ARegion *ar = CTX_wm_region(C); if (ar && (ar->regiontype == RGN_TYPE_HEADER)) { uiItemMenuF(layout, IFACE_("Header"), ICON_NONE, ED_screens_header_tools_menu_create, NULL); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index fa60ac0552b..4f260c35797 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -832,6 +832,7 @@ bool ui_but_is_popover_once_compat(const uiBut *but); extern bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT; extern bool ui_block_is_pie_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT; +extern bool ui_block_is_popup_any(const uiBlock *block) ATTR_WARN_UNUSED_RESULT; /* interface_context_menu.c */ bool ui_popup_context_menu_for_button(struct bContext *C, uiBut *but); diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c index 66f63fef82d..8893a5e17cc 100644 --- a/source/blender/editors/interface/interface_query.c +++ b/source/blender/editors/interface/interface_query.c @@ -114,6 +114,14 @@ bool ui_block_is_pie_menu(const uiBlock *block) return ((block->flag & UI_BLOCK_RADIAL) != 0); } +bool ui_block_is_popup_any(const uiBlock *block) +{ + return ( + ui_block_is_menu(block) || + ui_block_is_pie_menu(block) + ); +} + bool UI_block_is_empty(const uiBlock *block) { for (const uiBut *but = block->buttons.first; but; but = but->next) { |