From 48448aa89d0729e0dd2063bc7e8208bca6b6f3e7 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 9 Nov 2017 18:58:46 -0500 Subject: [PATCH] Don't close Menu if onAction() event is not consumed --- src/widgets/MenuItem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/widgets/MenuItem.cpp b/src/widgets/MenuItem.cpp index f1907767..5f8f3288 100644 --- a/src/widgets/MenuItem.cpp +++ b/src/widgets/MenuItem.cpp @@ -43,9 +43,13 @@ void MenuItem::onDragDrop(EventDragDrop &e) { return; EventAction eAction; + // TODO Perhaps remove this? It would require all onAction() methods to call this explicitly, which might be too annoying to change. + eAction.consumed = true; onAction(eAction); - // deletes `this` - gScene->setOverlay(NULL); + if (eAction.consumed) { + // deletes `this` + gScene->setOverlay(NULL); + } }