From eaf05748ff1fc2b1ced8fdb329661ff20d6b7b85 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Wed, 3 Jan 2018 18:05:49 +0200 Subject: Initial support for read receipts --- src/ui/OverlayModal.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ui') 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(); + } +} -- cgit 1.5.1