mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
feat: Add preview to message navigator
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user