mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 04:28:49 +03:00
Load content if no scrollbar is needed
This commit is contained in:
parent
8ebef4eed2
commit
0fd2199112
2 changed files with 10 additions and 1 deletions
|
@ -44,6 +44,10 @@ Rectangle {
|
||||||
} else {
|
} else {
|
||||||
positionViewAtIndex(model.currentIndex, ListView.End)
|
positionViewAtIndex(model.currentIndex, ListView.End)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (contentHeight < height) {
|
||||||
|
model.fetchHistory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +67,13 @@ Rectangle {
|
||||||
currentIndex = newIndex
|
currentIndex = newIndex
|
||||||
model.currentIndex = newIndex
|
model.currentIndex = newIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (contentHeight < height) {
|
||||||
|
model.fetchHistory();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onAtYBeginningChanged: if (atYBeginning) model.fetchHistory()
|
||||||
|
|
||||||
function updatePosition() {
|
function updatePosition() {
|
||||||
for (var y = chat.contentY + chat.height; y > chat.height; y -= 5) {
|
for (var y = chat.contentY + chat.height; y > chat.height; y -= 5) {
|
||||||
|
|
|
@ -53,7 +53,6 @@ TimelineViewManager::setHistoryView(const QString &room_id)
|
||||||
auto room = models.find(room_id);
|
auto room = models.find(room_id);
|
||||||
if (room != models.end()) {
|
if (room != models.end()) {
|
||||||
timeline_ = room.value().data();
|
timeline_ = room.value().data();
|
||||||
timeline_->fetchHistory();
|
|
||||||
emit activeTimelineChanged(timeline_);
|
emit activeTimelineChanged(timeline_);
|
||||||
nhlog::ui()->info("Activated room {}", room_id.toStdString());
|
nhlog::ui()->info("Activated room {}", room_id.toStdString());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue