Browse Source

Don't close Menu if onAction() event is not consumed

tags/v0.5.0
Andrew Belt 7 years ago
parent
commit
48448aa89d
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/widgets/MenuItem.cpp

+ 6
- 2
src/widgets/MenuItem.cpp View File

@@ -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);
}
}




Loading…
Cancel
Save