From 5ab588f40cc18a5c284d2d1e129c37b1bcd92229 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 17 May 2019 14:24:03 -0400 Subject: [PATCH] Prevent RoomEventDelegate startup position glitch --- TODO.md | 3 ++- harmonyqml/components/Chat/Chat.qml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index c4987857..a2a11d19 100644 --- a/TODO.md +++ b/TODO.md @@ -13,7 +13,9 @@ - RoomEventsList scrolling when resizing the window - UI + - Invite to room - Accounts delegates background + - SidePane delegates hover effect - Server selection - Register/Forgot? for SignIn dialog - Scaling @@ -32,7 +34,6 @@ - Major features - E2E - Device verification - - Member pane - Edit/delete own devices - Request room keys from own other devices - Auto-trust accounts within the same client diff --git a/harmonyqml/components/Chat/Chat.qml b/harmonyqml/components/Chat/Chat.qml index 2200a4ef..f5cfec97 100644 --- a/harmonyqml/components/Chat/Chat.qml +++ b/harmonyqml/components/Chat/Chat.qml @@ -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 } )