From f5a3a5b9ab362c58fa424261f313aa9cf46d2a98 Mon Sep 17 00:00:00 2001 From: Miguel Herranz Date: Sun, 7 Apr 2019 21:33:35 +0200 Subject: gui: Add close window shortcut CMD+W/CTRL+W is the standard shortcut to close a window without exiting the program. --- src/qt/guiutil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/qt/guiutil.cpp') diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 911322092c..5ec6fcb7a9 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include // for Qt::mightBeRichText #include #include @@ -378,6 +379,11 @@ void bringToFront(QWidget* w) } } +void handleCloseWindowShortcut(QWidget* w) +{ + QObject::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), w), &QShortcut::activated, w, &QWidget::close); +} + void openDebugLogfile() { fs::path pathDebug = GetDataDir() / "debug.log"; -- cgit v1.2.3