From 666b577bd5210a2a4197ba0e4998a4982505d111 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 14 Jun 2020 12:26:50 +0200 Subject: [PATCH] Close UserInfoPopup when Escape is pressed --- src/widgets/dialogs/UserInfoPopup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index 3957c4216..dd3585e7b 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -12,6 +12,7 @@ #include "singletons/Settings.hpp" #include "util/LayoutCreator.hpp" #include "util/PostToThread.hpp" +#include "util/Shortcut.hpp" #include "widgets/Label.hpp" #include "widgets/helper/EffectLabel.hpp" #include "widgets/helper/Line.hpp" @@ -60,6 +61,9 @@ UserInfoPopup::UserInfoPopup() this->setWindowFlag(Qt::Popup); #endif + // Close the popup when Escape is pressed + createWindowShortcut(this, "Escape", [this] { this->deleteLater(); }); + auto layout = LayoutCreator(this->getLayoutContainer()) .setLayoutType();