UI: Close windows by Escape key immediately

This commit is contained in:
Nodir Temirkhodjaev 2023-05-26 20:20:37 +03:00
parent 470ec4248a
commit 2b367f84da

View File

@ -53,11 +53,8 @@ void WidgetWindow::keyPressEvent(QKeyEvent *event)
{
QWidget::keyPressEvent(event);
if (event->isAutoRepeat())
return;
switch (event->key()) {
case Qt::Key_Escape: // Esc
case Qt::Key_Escape:
if (event->modifiers() == Qt::NoModifier) {
close();
}