From 2be7206879541363239393c1bed1572665cf4e2a Mon Sep 17 00:00:00 2001 From: pax Date: Sun, 5 Apr 2026 14:48:29 -0500 Subject: [PATCH] =?UTF-8?q?Trigger=20infinite=20scroll=20earlier=20?= =?UTF-8?q?=E2=80=94=20one=20row=20from=20bottom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fires reached_bottom when within one thumbnail row height of the bottom instead of 10px, so new posts load before you hit the very end. --- booru_viewer/gui/grid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/booru_viewer/gui/grid.py b/booru_viewer/gui/grid.py index 35dcb53..89f8dca 100644 --- a/booru_viewer/gui/grid.py +++ b/booru_viewer/gui/grid.py @@ -466,7 +466,9 @@ class ThumbnailGrid(QScrollArea): def _check_scroll_bottom(self, value: int) -> None: sb = self.verticalScrollBar() - if sb.maximum() > 0 and value >= sb.maximum() - 10: + # Trigger when within one row height of the bottom + threshold = THUMB_SIZE + THUMB_SPACING * 2 + if sb.maximum() > 0 and value >= sb.maximum() - threshold: self.reached_bottom.emit() if value <= 0 and sb.maximum() > 0: self.reached_top.emit()