diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-23 11:31:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-23 11:31:10 +0300 |
commit | f8a3636374b76f6db31be21beaa0e40857644bc4 (patch) | |
tree | 59cc2b172d8bf0e2eb0d838c2ac127029c0b0027 /source/blender/editors/include/UI_interface.h | |
parent | 6cd0484de8c765e5ce0f2072c7b10af0794ce7f8 (diff) |
UI: alternate fix for empty context menu
block and layout could be NULL and checking this everywhere
wasn't practical.
Instead of lazy initializing, add UI_popup_menu_end_or_cancel
which cancels empty popup menus.
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 94a0013d96b..6227ea15b71 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -395,6 +395,7 @@ uiPopupMenu *UI_popup_menu_begin_ex( struct bContext *C, const char *title, const char *block_name, int icon) ATTR_NONNULL(); void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *head); +bool UI_popup_menu_end_or_cancel(struct bContext *C, struct uiPopupMenu *head); struct uiLayout *UI_popup_menu_layout(uiPopupMenu *head); void UI_popup_menu_reports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL(); @@ -497,6 +498,8 @@ void UI_block_order_flip(uiBlock *block); void UI_block_flag_enable(uiBlock *block, int flag); void UI_block_flag_disable(uiBlock *block, int flag); +bool UI_block_is_empty(const uiBlock *block); + int UI_but_return_value_get(uiBut *but); void UI_but_drag_set_id(uiBut *but, struct ID *id); |