From 03845e4c92c66766d8bf13392759b46a5e0e774f Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 8 May 2018 17:16:52 -0500 Subject: [PATCH] Save/restore horz scroll when mirroring selection across splitter. --- src/calibre/gui2/library/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index a0630dc8d3..daea4c7f00 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -346,9 +346,12 @@ class BooksView(QTableView): # {{{ dest.selectionModel().select(src.selectionModel().selection(), QItemSelectionModel.ClearAndSelect) ci = dest.currentIndex() nci = src.selectionModel().currentIndex() + # Save/restore horz scroll. ci column may be scrolled out of view. + hpos = dest.horizontalScrollBar().value() if ci.isValid(): nci = dest.model().index(nci.row(), ci.column()) dest.selectionModel().setCurrentIndex(nci, QItemSelectionModel.NoUpdate) + dest.horizontalScrollBar().setValue(hpos) self.allow_mirroring = True def mirror_vscroll(self, src, *a):