1
0
Fork 0
mirror of synced 2024-06-02 10:44:40 +12:00

UninstallDialog: Handle Escape key

Handle Escape key to go through the proper cancellation routine.
This commit is contained in:
loathingKernel 2023-12-09 23:09:49 +02:00
parent f9e8dbe528
commit 0ea8d2c0d2
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD

View file

@ -1,5 +1,5 @@
from PyQt5.QtCore import Qt, pyqtSignal, QCoreApplication
from PyQt5.QtGui import QCloseEvent
from PyQt5.QtGui import QCloseEvent, QKeyEvent
from PyQt5.QtWidgets import (
QDialog,
QLabel,
@ -75,3 +75,8 @@ class UninstallDialog(QDialog):
def __on_cancel(self):
self.options.values = (None, None, None)
self.close()
def keyPressEvent(self, e: QKeyEvent) -> None:
if e.key() == Qt.Key_Escape:
e.accept()
self.__on_cancel()