Created shortcut to switch between card types on clayout.py

editor window (F3 and F4) because it should be simple to use them
single hand and together with Ctrl+1, 2 and 3 combos.
This commit is contained in:
evandrocoan 2021-07-11 22:40:43 -03:00
parent 9c354f5e6b
commit 85c236a417

View File

@ -185,6 +185,24 @@ class CardLayout(QDialog):
self,
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)):
QShortcut( # type: ignore
QKeySequence(f"Alt+{i+1}"),