mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When pressing Ctrl+Home/End preserve the horizontal scroll position in the book list
This commit is contained in:
parent
fce6681090
commit
6b99cd01c2
@ -807,6 +807,14 @@ class BooksView(QTableView): # {{{
|
||||
sm = self.selectionModel()
|
||||
sm.select(index, sm.ClearAndSelect|sm.Rows)
|
||||
|
||||
def keyPressEvent(self, ev):
|
||||
val = self.horizontalScrollBar().value()
|
||||
ret = super(BooksView, self).keyPressEvent(ev)
|
||||
if ev.isAccepted() and ev.key() in (Qt.Key_Home, Qt.Key_End
|
||||
) and ev.modifiers() & Qt.ControlModifier:
|
||||
self.horizontalScrollBar().setValue(val)
|
||||
return ret
|
||||
|
||||
def ids_to_rows(self, ids):
|
||||
row_map = OrderedDict()
|
||||
ids = frozenset(ids)
|
||||
|
Loading…
x
Reference in New Issue
Block a user