Prevent RoomEventDelegate startup position glitch

This commit is contained in:
miruka
2019-05-17 14:24:03 -04:00
parent 19c69b406a
commit 5ab588f40c
2 changed files with 10 additions and 1 deletions

View File

@@ -85,6 +85,8 @@ HColumnLayout {
onActiveViewChanged:
activeView ? restoreAnimation.start() : hideAnimation.start()
property bool wasHiddenOnce: false
NumberAnimation {
id: hideAnimation
target: roomSidePane
@@ -92,7 +94,9 @@ HColumnLayout {
duration: HStyle.animationDuration
from: target.width
to: 0
onStarted: {
target.wasHiddenOnce = true
target.oldWidth = target.width
target.Layout.minimumWidth = 0
}
@@ -105,6 +109,10 @@ HColumnLayout {
duration: HStyle.animationDuration
from: 0
to: target.oldWidth
// Prevent RoomEventDelegate positions glitch on startup
onStarted: if (! target.wasHiddenOnce) { complete() }
onStopped: target.Layout.minimumWidth = Qt.binding(
function() { return HStyle.avatar.size }
)