Preserve tag field focus when switching between cards
This commit is contained in:
parent
17d68cc957
commit
8f7f7db861
@ -1518,8 +1518,12 @@ update cards set usn=?, mod=?, did=? where id in """ + scids,
|
|||||||
self.editor.saveNow(self._onPreviousCard)
|
self.editor.saveNow(self._onPreviousCard)
|
||||||
|
|
||||||
def _onPreviousCard(self):
|
def _onPreviousCard(self):
|
||||||
|
tagfocus = self.editor.tags.hasFocus()
|
||||||
f = self.editor.currentField
|
f = self.editor.currentField
|
||||||
self._moveCur(QAbstractItemView.MoveUp)
|
self._moveCur(QAbstractItemView.MoveUp)
|
||||||
|
if tagfocus:
|
||||||
|
self.editor.tags.setFocus()
|
||||||
|
return
|
||||||
self.editor.web.setFocus()
|
self.editor.web.setFocus()
|
||||||
self.editor.web.eval("focusField(%d)" % f)
|
self.editor.web.eval("focusField(%d)" % f)
|
||||||
|
|
||||||
@ -1527,8 +1531,12 @@ update cards set usn=?, mod=?, did=? where id in """ + scids,
|
|||||||
self.editor.saveNow(self._onNextCard)
|
self.editor.saveNow(self._onNextCard)
|
||||||
|
|
||||||
def _onNextCard(self):
|
def _onNextCard(self):
|
||||||
|
tagfocus = self.editor.tags.hasFocus()
|
||||||
f = self.editor.currentField
|
f = self.editor.currentField
|
||||||
self._moveCur(QAbstractItemView.MoveDown)
|
self._moveCur(QAbstractItemView.MoveDown)
|
||||||
|
if tagfocus:
|
||||||
|
self.editor.tags.setFocus()
|
||||||
|
return
|
||||||
self.editor.web.setFocus()
|
self.editor.web.setFocus()
|
||||||
self.editor.web.eval("focusField(%d)" % f)
|
self.editor.web.eval("focusField(%d)" % f)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user