mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
FTS dialog: When keyboard navigation changes the current item ensure it stays visible
This commit is contained in:
parent
78be572ce0
commit
ef98d9a6a1
@ -379,6 +379,14 @@ class ResultsView(QTreeView):
|
|||||||
self.setModel(self.m)
|
self.setModel(self.m)
|
||||||
self.delegate = SearchDelegate(self)
|
self.delegate = SearchDelegate(self)
|
||||||
self.setItemDelegate(self.delegate)
|
self.setItemDelegate(self.delegate)
|
||||||
|
self.setUniformRowHeights(True)
|
||||||
|
|
||||||
|
def keyPressEvent(self, ev):
|
||||||
|
i = self.currentIndex()
|
||||||
|
ret = super().keyPressEvent(ev)
|
||||||
|
if self.currentIndex() != i:
|
||||||
|
self.scrollTo(self.currentIndex())
|
||||||
|
return ret
|
||||||
|
|
||||||
def currentChanged(self, current, previous):
|
def currentChanged(self, current, previous):
|
||||||
results, individual_match = self.m.data_for_index(current)
|
results, individual_match = self.m.data_for_index(current)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user