mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Allow closing the Preview Dialog with Ctrl+Shift+P
This commit is contained in:
parent
6431f0b6b1
commit
097fa16783
1 changed files with 4 additions and 0 deletions
|
@ -16,6 +16,7 @@ from aqt.qt import (
|
||||||
QIcon,
|
QIcon,
|
||||||
QKeySequence,
|
QKeySequence,
|
||||||
QPixmap,
|
QPixmap,
|
||||||
|
QShortcut,
|
||||||
Qt,
|
Qt,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
QWidget,
|
QWidget,
|
||||||
|
@ -63,6 +64,9 @@ class Previewer(QDialog):
|
||||||
def _create_gui(self):
|
def _create_gui(self):
|
||||||
self.setWindowTitle(tr(TR.ACTIONS_PREVIEW))
|
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)
|
qconnect(self.finished, self._on_finished)
|
||||||
self.silentlyClose = True
|
self.silentlyClose = True
|
||||||
self.vbox = QVBoxLayout()
|
self.vbox = QVBoxLayout()
|
||||||
|
|
Loading…
Reference in a new issue