diff --git a/TODO.md b/TODO.md index bd73ba41..6ad9adce 100644 --- a/TODO.md +++ b/TODO.md @@ -92,7 +92,6 @@ - Linkify URLs in topic text areas -- Expand the room pane if it's currently too small to show room settings - Use a loader for items not in view for the `HTabContainer`'s `SwipeView` - Make "Cancel" buttons consistent, and able to cancel running Backend diff --git a/src/gui/Base/MultiviewPane.qml b/src/gui/Base/MultiviewPane.qml index f3905e87..9d63b52f 100644 --- a/src/gui/Base/MultiviewPane.qml +++ b/src/gui/Base/MultiviewPane.qml @@ -14,12 +14,21 @@ HDrawer { property int buttonWidth: buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0 + property bool requireDefaultSize: false + readonly property alias buttonRepeater: buttonRepeater readonly property alias swipeView: swipeView defaultSize: buttonRepeater.count * buttonWidth - minimumSize: buttonWidth + minimumSize: requireDefaultSize ? defaultSize : buttonWidth + + Behavior on minimumSize { + HNumberAnimation { + overshoot: requireDefaultSize ? 1 : 4 + factor: 0.75 + } + } HColumnLayout { anchors.fill: parent diff --git a/src/gui/Pages/Chat/Chat.qml b/src/gui/Pages/Chat/Chat.qml index 3dc4c490..c614e4c4 100644 --- a/src/gui/Pages/Chat/Chat.qml +++ b/src/gui/Pages/Chat/Chat.qml @@ -74,7 +74,15 @@ Item { HLoader { id: loader - anchors.rightMargin: ready ? roomPane.visibleSize : 0 + anchors.rightMargin: + ready && + ! ( + roomPane.requireDefaultSize && + roomPane.minimumSize > roomPane.maximumSize + ) ? + roomPane.visibleSize : + 0 + anchors.fill: parent visible: ready ? ! roomPane.hidden || anchors.rightMargin < width : true diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml index 1ca1ed46..ea2f2716 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberView.qml @@ -10,6 +10,8 @@ HColumnLayout { readonly property var modelSyncId: [chat.userId, chat.roomId, "filtered_members"] + readonly property alias viewDepth: stackView.depth + HStackView { id: stackView diff --git a/src/gui/Pages/Chat/RoomPane/RoomPane.qml b/src/gui/Pages/Chat/RoomPane/RoomPane.qml index a24908f2..d1db4f96 100644 --- a/src/gui/Pages/Chat/RoomPane/RoomPane.qml +++ b/src/gui/Pages/Chat/RoomPane/RoomPane.qml @@ -32,6 +32,9 @@ MultiviewPane { buttonWidth: buttonRepeater.count >= 1 ? buttonRepeater.itemAt(1).implicitWidth : 0 + requireDefaultSize: + swipeView.currentIndex !== 0 || swipeView.currentItem.viewDepth > 1 + buttonsBackgroundColor: theme.chat.roomPane.topBar.background background: Rectangle { color: theme.chat.roomPane.background }