From c67e1bfc7954af572a7fc96374b58eb839c89fcd Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 15 May 2019 02:25:40 -0400 Subject: [PATCH] Fix hiding members pane not giving space to chat --- harmonyqml/components/Chat/Chat.qml | 29 +++++++++++++++++++++++++---- harmonyqml/components/UI.qml | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/harmonyqml/components/Chat/Chat.qml b/harmonyqml/components/Chat/Chat.qml index 954e8567..2200a4ef 100644 --- a/harmonyqml/components/Chat/Chat.qml +++ b/harmonyqml/components/Chat/Chat.qml @@ -81,14 +81,35 @@ HColumnLayout { id: roomSidePane activeView: roomHeader.activeButton - transform: Translate { - x: roomSidePane.activeView ? 0 : roomSidePane.width + property int oldWidth: width + onActiveViewChanged: + activeView ? restoreAnimation.start() : hideAnimation.start() - Behavior on x { - NumberAnimation { duration: HStyle.animationDuration } + NumberAnimation { + id: hideAnimation + target: roomSidePane + properties: "width" + duration: HStyle.animationDuration + from: target.width + to: 0 + onStarted: { + target.oldWidth = target.width + target.Layout.minimumWidth = 0 } } + NumberAnimation { + id: restoreAnimation + target: roomSidePane + properties: "width" + duration: HStyle.animationDuration + from: 0 + to: target.oldWidth + onStopped: target.Layout.minimumWidth = Qt.binding( + function() { return HStyle.avatar.size } + ) + } + collapsed: width < Layout.minimumWidth + 8 property bool wasSnapped: false diff --git a/harmonyqml/components/UI.qml b/harmonyqml/components/UI.qml index adb54d22..081a2be7 100644 --- a/harmonyqml/components/UI.qml +++ b/harmonyqml/components/UI.qml @@ -73,7 +73,7 @@ Item { if (pageStack.initialPageSet) { return } pageStack.initialPageSet = true showPage(accountsLoggedIn ? "Default" : "SignIn") - if (accountsLoggedIn) { initialRoomTimer.start() } + //if (accountsLoggedIn) { initialRoomTimer.start() } } Timer {