mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
parent
e2fc676c77
commit
7ddcab3902
2 changed files with 17 additions and 4 deletions
|
@ -77,6 +77,19 @@ ListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: TimelineManager
|
||||||
|
onFocusChanged: readTimer.running = TimelineManager.isWindowFocused
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: readTimer
|
||||||
|
|
||||||
|
// force current read index to update
|
||||||
|
onTriggered: chat.model.setCurrentIndex(chat.model.currentIndex)
|
||||||
|
interval: 1000
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: sectionHeader
|
id: sectionHeader
|
||||||
|
|
||||||
|
@ -193,7 +206,7 @@ ListView {
|
||||||
Connections {
|
Connections {
|
||||||
target: chat
|
target: chat
|
||||||
onMovementEnded: {
|
onMovementEnded: {
|
||||||
if (y + height + 2 * chat.spacing > chat.contentY + timelineRoot.height && y < chat.contentY + timelineRoot.height)
|
if (y + height + 2 * chat.spacing > chat.contentY + chat.height && y < chat.contentY + chat.height)
|
||||||
chat.model.currentIndex = index;
|
chat.model.currentIndex = index;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -735,14 +735,14 @@ TimelineModel::updateLastMessage()
|
||||||
void
|
void
|
||||||
TimelineModel::setCurrentIndex(int index)
|
TimelineModel::setCurrentIndex(int index)
|
||||||
{
|
{
|
||||||
if (!ChatPage::instance()->isActiveWindow())
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto oldIndex = idToIndex(currentId);
|
auto oldIndex = idToIndex(currentId);
|
||||||
currentId = indexToId(index);
|
currentId = indexToId(index);
|
||||||
if (index != oldIndex)
|
if (index != oldIndex)
|
||||||
emit currentIndexChanged(index);
|
emit currentIndexChanged(index);
|
||||||
|
|
||||||
|
if (!ChatPage::instance()->isActiveWindow())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!currentId.startsWith("m")) {
|
if (!currentId.startsWith("m")) {
|
||||||
auto oldReadIndex =
|
auto oldReadIndex =
|
||||||
cache::getEventIndex(roomId().toStdString(), currentReadId.toStdString());
|
cache::getEventIndex(roomId().toStdString(), currentReadId.toStdString());
|
||||||
|
|
Loading…
Reference in a new issue