From 39f3b6ce93017534f30392b33017039f9c945875 Mon Sep 17 00:00:00 2001 From: abdo Date: Fri, 19 Feb 2021 10:40:30 +0300 Subject: [PATCH] Shortcuts to preview clozes in card layout screen Assign Alt+{number} to select cloze cards. --- qt/aqt/clayout.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qt/aqt/clayout.py b/qt/aqt/clayout.py index fc935d753..590330ec7 100644 --- a/qt/aqt/clayout.py +++ b/qt/aqt/clayout.py @@ -187,6 +187,12 @@ class CardLayout(QDialog): self, activated=self.tform.style_button.click, ) + for i in range(min(len(self.cloze_numbers), 9)): + QShortcut( # type: ignore + QKeySequence(f"Alt+{i+1}"), + self, + activated=lambda n=i: self.pform.cloze_number_combo.setCurrentIndex(n), + ) # Main area setup ##########################################################################