Allow closing the Preview Dialog with Ctrl+Shift+P

This commit is contained in:
Henrik Giesel 2021-01-10 01:34:59 +01:00
parent 3e1cf6c986
commit 90e4cb5bae

View file

@ -16,6 +16,7 @@ from aqt.qt import (
QIcon,
QKeySequence,
QPixmap,
QShortcut,
Qt,
QVBoxLayout,
QWidget,
@ -63,6 +64,9 @@ class Previewer(QDialog):
def _create_gui(self):
self.setWindowTitle(tr(TR.ACTIONS_PREVIEW))
self.close_shortcut = QShortcut(QKeySequence("Ctrl+Shift+P"), self)
qconnect(self.close_shortcut.activated, self.close)
qconnect(self.finished, self._on_finished)
self.silentlyClose = True
self.vbox = QVBoxLayout()