summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--resources/qml/MessageView.qml7
1 files changed, 7 insertions, 0 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index 98b9748a..df39f3d1 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -59,6 +59,13 @@ Item {
         spacing: 2
         verticalLayoutDirection: ListView.BottomToTop
 
+        property int lastScrollPos: 0
+
+        // Fixup the scroll position when the height changes. Without this, the view is kept around the center of the currently visible content, while we usually want to stick to the bottom.
+        onMovementEnded: lastScrollPos = (contentY+height)
+        onModelChanged: lastScrollPos = (contentY+height)
+        onHeightChanged: contentY = (lastScrollPos-height)
+
         Component {
             id: defaultMessageStyle