1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui/OverlayModal.cc b/src/ui/OverlayModal.cc
index 4fb57175..290d28e5 100644
--- a/src/ui/OverlayModal.cc
+++ b/src/ui/OverlayModal.cc
@@ -47,6 +47,8 @@ OverlayModal::OverlayModal(QWidget *parent, QWidget *content)
if (animation_->direction() == QAbstractAnimation::Forward)
this->close();
});
+
+ content->setFocus();
}
void
@@ -72,3 +74,12 @@ OverlayModal::fadeOut()
animation_->setDirection(QAbstractAnimation::Forward);
animation_->start();
}
+
+void
+OverlayModal::keyPressEvent(QKeyEvent *event)
+{
+ if (event->key() == Qt::Key_Escape) {
+ event->accept();
+ fadeOut();
+ }
+}
|