May I suggest the following patch? (Maybe the 'top' and 'bottom' should be modified too, though):
diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 144e3108df..15c6ad7f40 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -1305,8 +1305,10 @@ def scroll_to_row(self, row): vsb.setValue(vertical_position) elif pos == 'bottom': vsb.setValue(vertical_position - viewport_height + cell_height) - else: + elif self.verticalScrollMode() == QAbstractItemView.ScrollMode.ScrollPerPixel: vsb.setValue(vertical_position - ((viewport_height - cell_height) // 2)) + else: + vsb.setValue(row - (viewport_height // (cell_height * 2)))
@property def current_book(self):
May I suggest the following patch? (Maybe the 'top' and 'bottom' should be modified too, though):
diff --git a/src/calibre/ gui2/library/ views.py b/src/calibre/ gui2/library/ views.py .15c6ad7f40 100644 gui2/library/ views.py gui2/library/ views.py
vsb. setValue( vertical_ position)
vsb. setValue( vertical_ position - viewport_height + cell_height) rollMode( ) == QAbstractItemVi ew.ScrollMode. ScrollPerPixel:
vsb. setValue( vertical_ position - ((viewport_height - cell_height) // 2))
index 144e3108df.
--- a/src/calibre/
+++ b/src/calibre/
@@ -1305,8 +1305,10 @@ def scroll_to_row(self, row):
elif pos == 'bottom':
- else:
+ elif self.verticalSc
+ else:
+ vsb.setValue(row - (viewport_height // (cell_height * 2)))
@property
def current_book(self):