diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-10-23 01:56:53 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-10-23 01:56:53 +0200 |
commit | e3ad60911d4483dbc9af6a839f97c23c9fa1dae3 (patch) | |
tree | 68bfc67e100fc6c29078be3150a1ff851b3551b3 /resources | |
parent | Migrate olm sessions to be stored in one database instead of thousands (diff) | |
download | nheko-e3ad60911d4483dbc9af6a839f97c23c9fa1dae3.tar.xz |
Fix scroll position jumping when replying or resizing the window
Diffstat (limited to 'resources')
-rw-r--r-- | resources/qml/MessageView.qml | 7 |
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 |