diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 03:45:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-31 03:45:35 +0300 |
commit | 0c955ed6eab2544ebad8823e509cc348b33c3556 (patch) | |
tree | bfdbc4113470300fde5586c38ccc278537e523d1 | |
parent | 56754226deb0433654ec1a866c756b60ea176dd5 (diff) |
Fix T56155: Header shows in popover context menu
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_query.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 4f260c35797..d4fccc48bfc 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -831,6 +831,7 @@ bool ui_but_is_toggle(const uiBut *but); 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_popover(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; diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c index 8893a5e17cc..d0f7e1341de 100644 --- a/source/blender/editors/interface/interface_query.c +++ b/source/blender/editors/interface/interface_query.c @@ -109,6 +109,11 @@ bool ui_block_is_menu(const uiBlock *block) ((block->flag & UI_BLOCK_KEEP_OPEN) == 0)); } +bool ui_block_is_popover(const uiBlock *block) +{ + return (block->flag & UI_BLOCK_POPOVER) != 0; +} + bool ui_block_is_pie_menu(const uiBlock *block) { return ((block->flag & UI_BLOCK_RADIAL) != 0); @@ -118,6 +123,7 @@ bool ui_block_is_popup_any(const uiBlock *block) { return ( ui_block_is_menu(block) || + ui_block_is_popover(block) || ui_block_is_pie_menu(block) ); } |