Merge pull request #1034 from abdnh/clayout-cloze-shortcuts

Shortcuts to preview clozes in card layout screen
This commit is contained in:
Damien Elmes 2021-02-22 10:07:16 +10:00 committed by GitHub
commit f41ec183c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
##########################################################################