From dfcd169444799fdc8fa2e5e3097cd38ce91c24fb Mon Sep 17 00:00:00 2001 From: DuckSoft Date: Thu, 13 Aug 2020 19:10:09 +0800 Subject: [PATCH] feat: control+w = close window --- src/ui/windows/w_MainWindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/windows/w_MainWindow.cpp b/src/ui/windows/w_MainWindow.cpp index e178e434..29d52705 100644 --- a/src/ui/windows/w_MainWindow.cpp +++ b/src/ui/windows/w_MainWindow.cpp @@ -447,11 +447,18 @@ void MainWindow::keyPressEvent(QKeyEvent *e) this->close(); } } + // Ctrl + Q = Exit else if (e->modifiers() & Qt::ControlModifier && e->key() == Qt::Key_Q) { if (QvMessageBoxAsk(this, tr("Quit Qv2ray"), tr("Are you sure to exit Qv2ray?")) == QMessageBox::Yes) Action_Exit(); } + // Control + W = Close Window + else if (e->modifiers() & Qt::ControlModifier && e->key() == Qt::Key_W) + { + if (this->isActiveWindow()) + this->close(); + } } void MainWindow::keyReleaseEvent(QKeyEvent *e)