Load content if no scrollbar is needed

remotes/origin/0.7.0-dev
Nicolas Werner 5 years ago
parent 8ebef4eed2
commit 0fd2199112
  1. 10
      resources/qml/TimelineView.qml
  2. 1
      src/timeline2/TimelineViewManager.cpp

@ -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);

@ -53,7 +53,6 @@ TimelineViewManager::setHistoryView(const QString &room_id)
auto room = models.find(room_id);
if (room != models.end()) {
timeline_ = room.value().data();
timeline_->fetchHistory();
emit activeTimelineChanged(timeline_);
nhlog::ui()->info("Activated room {}", room_id.toStdString());
}

Loading…
Cancel
Save