mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Save/restore horz scroll when mirroring selection across splitter.
This commit is contained in:
parent
10b1829fe8
commit
03845e4c92
@ -346,9 +346,12 @@ class BooksView(QTableView): # {{{
|
|||||||
dest.selectionModel().select(src.selectionModel().selection(), QItemSelectionModel.ClearAndSelect)
|
dest.selectionModel().select(src.selectionModel().selection(), QItemSelectionModel.ClearAndSelect)
|
||||||
ci = dest.currentIndex()
|
ci = dest.currentIndex()
|
||||||
nci = src.selectionModel().currentIndex()
|
nci = src.selectionModel().currentIndex()
|
||||||
|
# Save/restore horz scroll. ci column may be scrolled out of view.
|
||||||
|
hpos = dest.horizontalScrollBar().value()
|
||||||
if ci.isValid():
|
if ci.isValid():
|
||||||
nci = dest.model().index(nci.row(), ci.column())
|
nci = dest.model().index(nci.row(), ci.column())
|
||||||
dest.selectionModel().setCurrentIndex(nci, QItemSelectionModel.NoUpdate)
|
dest.selectionModel().setCurrentIndex(nci, QItemSelectionModel.NoUpdate)
|
||||||
|
dest.horizontalScrollBar().setValue(hpos)
|
||||||
self.allow_mirroring = True
|
self.allow_mirroring = True
|
||||||
|
|
||||||
def mirror_vscroll(self, src, *a):
|
def mirror_vscroll(self, src, *a):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user