Merge pull request #1288 from evandroforks/clayout_next_card_shortcut

Created shortcut to switch between card types on clayout.py
This commit is contained in:
Damien Elmes 2021-07-16 10:51:40 +10:00 committed by GitHub
commit 87185d5365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,6 +185,24 @@ class CardLayout(QDialog):
self, self,
activated=self.tform.style_button.click, activated=self.tform.style_button.click,
) )
QShortcut( # type: ignore
QKeySequence("F3"),
self,
activated=lambda: (
self.update_current_ordinal_and_redraw(self.ord - 1)
if self.ord - 1 > -1
else None
),
)
QShortcut( # type: ignore
QKeySequence("F4"),
self,
activated=lambda: (
self.update_current_ordinal_and_redraw(self.ord + 1)
if self.ord + 1 < len(self.templates)
else None
),
)
for i in range(min(len(self.cloze_numbers), 9)): for i in range(min(len(self.cloze_numbers), 9)):
QShortcut( # type: ignore QShortcut( # type: ignore
QKeySequence(f"Alt+{i+1}"), QKeySequence(f"Alt+{i+1}"),