feat: Add preview to message navigator

This commit is contained in:
Petr Mironychev
2026-05-27 23:03:10 +02:00
parent 66e25300e8
commit af898bd255
4 changed files with 165 additions and 61 deletions

View File

@@ -201,6 +201,11 @@ ChatRootView {
property bool userScrolledUp: false
function syncNavigatorCurrent() {
const top = indexAt(10, contentY + 4)
messageNavigator.updateCurrentFromModelIndex(top)
}
Layout.fillWidth: true
Layout.fillHeight: true
leftMargin: 3
@@ -210,6 +215,8 @@ ChatRootView {
boundsBehavior: Flickable.StopAtBounds
cacheBuffer: 2000
onContentYChanged: Qt.callLater(syncNavigatorCurrent)
onMovingChanged: {
if (moving) {
userScrolledUp = !atYEnd
@@ -296,6 +303,7 @@ ChatRootView {
if (!userScrolledUp) {
root.scrollToBottom()
}
Qt.callLater(syncNavigatorCurrent)
}
onContentHeightChanged: {