mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
shortcut keys to jump to first 9 templates
This commit is contained in:
parent
be1514a97b
commit
c4029e5680
1 changed files with 9 additions and 0 deletions
|
@ -42,6 +42,7 @@ class CardLayout(QDialog):
|
|||
self.setupTopArea()
|
||||
self.setupMainArea()
|
||||
self.setupButtons()
|
||||
self.setupShortcuts()
|
||||
self.setWindowTitle(_("Card Types for %s") % self.model['name'])
|
||||
v1 = QVBoxLayout()
|
||||
v1.addWidget(self.topArea)
|
||||
|
@ -69,6 +70,14 @@ class CardLayout(QDialog):
|
|||
self.redrawing = False
|
||||
self.onCardSelected(self.ord)
|
||||
|
||||
def setupShortcuts(self):
|
||||
for i in range(1,9):
|
||||
QShortcut(QKeySequence("Ctrl+%d" % i), self, activated=lambda i=i: self.selectCard(i))
|
||||
|
||||
def selectCard(self, n):
|
||||
self.ord = n-1
|
||||
self.redraw()
|
||||
|
||||
def setupTopArea(self):
|
||||
self.topArea = QWidget()
|
||||
self.topAreaForm = aqt.forms.clayout_top.Ui_Form()
|
||||
|
|
Loading…
Reference in a new issue