mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
When sorting the book list, keep the current book visible after the sort completes. Fixes #7504 (Book List to Maintain book pointer when the list is sorted by another column)
This commit is contained in:
parent
ef23a7c8c4
commit
ec7bd86288
@ -105,7 +105,8 @@ class BooksView(QTableView): # {{{
|
|||||||
hv.setCursor(Qt.PointingHandCursor)
|
hv.setCursor(Qt.PointingHandCursor)
|
||||||
self.selected_ids = []
|
self.selected_ids = []
|
||||||
self._model.about_to_be_sorted.connect(self.about_to_be_sorted)
|
self._model.about_to_be_sorted.connect(self.about_to_be_sorted)
|
||||||
self._model.sorting_done.connect(self.sorting_done)
|
self._model.sorting_done.connect(self.sorting_done,
|
||||||
|
type=Qt.QueuedConnection)
|
||||||
|
|
||||||
# Column Header Context Menu {{{
|
# Column Header Context Menu {{{
|
||||||
def column_header_context_handler(self, action=None, column=None):
|
def column_header_context_handler(self, action=None, column=None):
|
||||||
@ -227,6 +228,7 @@ class BooksView(QTableView): # {{{
|
|||||||
sm = self.selectionModel()
|
sm = self.selectionModel()
|
||||||
for idx in indices:
|
for idx in indices:
|
||||||
sm.select(idx, sm.Select|sm.Rows)
|
sm.select(idx, sm.Select|sm.Rows)
|
||||||
|
self.scroll_to_row(indices[0].row())
|
||||||
self.selected_ids = []
|
self.selected_ids = []
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user