From f8a3636374b76f6db31be21beaa0e40857644bc4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 23 Jun 2018 10:31:10 +0200 Subject: 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. --- source/blender/editors/include/UI_interface.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors/include/UI_interface.h') 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); -- cgit v1.2.3