Trigger infinite scroll earlier — one row from bottom
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.
This commit is contained in:
parent
6e5b348ff7
commit
2be7206879
@ -466,7 +466,9 @@ class ThumbnailGrid(QScrollArea):
|
|||||||
|
|
||||||
def _check_scroll_bottom(self, value: int) -> None:
|
def _check_scroll_bottom(self, value: int) -> None:
|
||||||
sb = self.verticalScrollBar()
|
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()
|
self.reached_bottom.emit()
|
||||||
if value <= 0 and sb.maximum() > 0:
|
if value <= 0 and sb.maximum() > 0:
|
||||||
self.reached_top.emit()
|
self.reached_top.emit()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user