mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression that broke sync between the cover browser and the book list
This commit is contained in:
parent
3d551ff1ab
commit
e2c2067095
@ -426,6 +426,14 @@ class BooksView(QTableView): # {{{
|
||||
if dy != 0:
|
||||
self.column_header.update()
|
||||
|
||||
def scroll_to_row(self, row):
|
||||
if row > -1:
|
||||
h = self.horizontalHeader()
|
||||
for i in range(h.count()):
|
||||
if not h.isSectionHidden(i):
|
||||
self.scrollTo(self.model().index(row, i))
|
||||
break
|
||||
|
||||
def close(self):
|
||||
self._model.close()
|
||||
|
||||
|
@ -800,7 +800,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
d.layout().addWidget(self.cover_flow)
|
||||
self.cover_flow.setVisible(True)
|
||||
self.cover_flow.setFocus(Qt.OtherFocusReason)
|
||||
self.library_view.scrollTo(self.library_view.currentIndex())
|
||||
self.library_view.scroll_to_row(self.library_view.currentIndex().row())
|
||||
d.show()
|
||||
d.finished.connect(self.sidebar.external_cover_flow_finished)
|
||||
self.cf_dialog = d
|
||||
@ -824,7 +824,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
self.library_view.currentIndex())
|
||||
self.cover_flow.setVisible(True)
|
||||
self.cover_flow.setFocus(Qt.OtherFocusReason)
|
||||
self.library_view.scrollTo(self.library_view.currentIndex())
|
||||
self.library_view.scroll_to_row(self.library_view.currentIndex().row())
|
||||
self.cover_flow_sync_timer.start(500)
|
||||
else:
|
||||
self.cover_flow_sync_timer.stop()
|
||||
@ -922,7 +922,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
index = m.index(row, 0)
|
||||
if self.library_view.currentIndex().row() != row and index.isValid():
|
||||
self.cover_flow_sync_flag = False
|
||||
self.library_view.scrollTo(index)
|
||||
self.library_view.scroll_to_row(index.row())
|
||||
sm = self.library_view.selectionModel()
|
||||
sm.select(index, sm.ClearAndSelect|sm.Rows)
|
||||
self.library_view.setCurrentIndex(index)
|
||||
|
Loading…
x
Reference in New Issue
Block a user