diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-22 20:42:01 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-22 20:42:01 +0200 |
| commit | 5818a157a3fc03e15e6cd1523bbe9f442b535148 (patch) | |
| tree | 7371a8b5c11fc298d1177b72cf4c2264d8ca4dbb | |
| parent | 87ff20c96d9a8faa71b03eb0ca912d0ebf8aca7a (diff) | |
| download | wallhaven-dl-master.tar.gz wallhaven-dl-master.zip | |
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 <noreply@anthropic.com>
| -rwxr-xr-x | wallhaven-dl | 5 |
1 files changed, 5 insertions, 0 deletions
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) |
