From 5818a157a3fc03e15e6cd1523bbe9f442b535148 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 20:42:01 +0200 Subject: Load the next results page when scrolling near the bottom The Load more button stays for when the first page does not fill the grid, and its enabled state doubles as the guard against duplicate or out-of-range page requests. Co-Authored-By: Claude Opus 5.5 --- wallhaven-dl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wallhaven-dl b/wallhaven-dl index 1f30f49..6ccf19f 100755 --- a/wallhaven-dl +++ b/wallhaven-dl @@ -325,6 +325,11 @@ class Main(QMainWindow): self.query.returnPressed.connect(self.search) search.clicked.connect(self.search) self.more.clicked.connect(lambda: self.search(page=self.page + 1)) + # infinite scroll: near the bottom, load the next page; the button's enabled state + # already means "another page exists and none is in flight" + bar = self.grid.verticalScrollBar() + bar.valueChanged.connect(lambda v: v >= bar.maximum() - bar.pageStep() // 2 + and self.more.isEnabled() and self.more.click()) lowres.clicked.connect(self.find_lowres) self.folder.clicked.connect(self.choose_folder) download.clicked.connect(self.download) -- cgit v1.2.3