mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix scroll position jumping when replying or resizing the window
This commit is contained in:
parent
d45dc6c77b
commit
e3ad60911d
1 changed files with 7 additions and 0 deletions
|
@ -59,6 +59,13 @@ Item {
|
||||||
spacing: 2
|
spacing: 2
|
||||||
verticalLayoutDirection: ListView.BottomToTop
|
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 {
|
Component {
|
||||||
id: defaultMessageStyle
|
id: defaultMessageStyle
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue