mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-21 11:20:49 +08:00
feat: control+w = close window
This commit is contained in:
parent
828d68fb63
commit
dfcd169444
@ -447,11 +447,18 @@ void MainWindow::keyPressEvent(QKeyEvent *e)
|
|||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Ctrl + Q = Exit
|
||||||
else if (e->modifiers() & Qt::ControlModifier && e->key() == Qt::Key_Q)
|
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)
|
if (QvMessageBoxAsk(this, tr("Quit Qv2ray"), tr("Are you sure to exit Qv2ray?")) == QMessageBox::Yes)
|
||||||
Action_Exit();
|
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)
|
void MainWindow::keyReleaseEvent(QKeyEvent *e)
|
||||||
|
Loading…
Reference in New Issue
Block a user