gui: Add close window shortcut

CMD+W/CTRL+W is the standard shortcut to close a window without
exiting the program.
This commit is contained in:
Miguel Herranz
2019-04-07 21:33:35 +02:00
parent a064e005fa
commit f5a3a5b9ab
15 changed files with 41 additions and 0 deletions

View File

@@ -54,6 +54,7 @@
#include <QSettings>
#include <QSize>
#include <QString>
#include <QShortcut>
#include <QTextDocument> // for Qt::mightBeRichText
#include <QThread>
#include <QUrlQuery>
@@ -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";