summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-10-09 19:34:57 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2019-11-23 20:06:15 +0100
commit0fd2199112be88a17125ea5630ce6184eb0758ca (patch)
treedb3295d192be29755f5b1104fa3e5d64e1ea951e /resources
parentSize images/videos by timeline width (diff)
downloadnheko-0fd2199112be88a17125ea5630ce6184eb0758ca.tar.xz
Load content if no scrollbar is needed
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/TimelineView.qml10
1 files changed, 10 insertions, 0 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index a758db9a..ef1db0f0 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -44,6 +44,10 @@ Rectangle {
 				} else {
 					positionViewAtIndex(model.currentIndex, ListView.End)
 				}
+
+				if (contentHeight < height) {
+					model.fetchHistory();
+				}
 			}
 		}
 
@@ -63,8 +67,14 @@ Rectangle {
 				currentIndex = newIndex
 				model.currentIndex = newIndex
 			}
+
+			if (contentHeight < height) {
+				model.fetchHistory();
+			}
 		}
 
+		onAtYBeginningChanged: if (atYBeginning) model.fetchHistory()
+
 		function updatePosition() {
 			for (var y = chat.contentY + chat.height; y > chat.height; y -= 5) {
 				var i = chat.itemAt(100, y);