Edit Book: Spell Check tool: Typing with the word list selected now scrolls the word list to ensure the newly selected word is visible

This commit is contained in:
Kovid Goyal 2016-11-08 08:36:51 +05:30
parent f07c4a91dc
commit 550a8d209d

View File

@ -830,11 +830,11 @@ class WordsView(QTableView):
self.copy_to_clipboard() self.copy_to_clipboard()
ev.accept() ev.accept()
return return
before = self.currentIndex()
ret = QTableView.keyPressEvent(self, ev) ret = QTableView.keyPressEvent(self, ev)
if ev.key() in (Qt.Key_PageUp, Qt.Key_PageDown, Qt.Key_Up, Qt.Key_Down): after = self.currentIndex()
idx = self.currentIndex() if after.row() != before.row() and after.isValid():
if idx.isValid(): self.scrollTo(after)
self.scrollTo(idx)
return ret return ret
def highlight_row(self, row): def highlight_row(self, row):