From fe40d117b2fc149f7f0f8ee1bcdf527270a5d9e8 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 19 Mar 2020 00:13:19 -0400 Subject: [PATCH] Fix room pane default size --- src/gui/Base/MultiviewPane.qml | 10 ++++++---- src/gui/Pages/Chat/RoomPane/RoomPane.qml | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gui/Base/MultiviewPane.qml b/src/gui/Base/MultiviewPane.qml index 1dedca69..3bc75ec1 100644 --- a/src/gui/Base/MultiviewPane.qml +++ b/src/gui/Base/MultiviewPane.qml @@ -6,13 +6,15 @@ import QtQuick.Layouts 1.12 HDrawer { id: pane - defaultSize: buttonRepeater.summedImplicitWidth - minimumSize: - buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0 + defaultSize: buttonRepeater.count * buttonWidth + minimumSize: buttonWidth property color buttonsBackgroundColor + property int buttonWidth: + buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0 + readonly property alias buttonRepeater: buttonRepeater readonly property alias swipeView: swipeView @@ -33,7 +35,7 @@ HDrawer { width: parent.width populate: null - HRepeater { + Repeater { id: buttonRepeater } } diff --git a/src/gui/Pages/Chat/RoomPane/RoomPane.qml b/src/gui/Pages/Chat/RoomPane/RoomPane.qml index 7a7a9c14..18ed4eed 100644 --- a/src/gui/Pages/Chat/RoomPane/RoomPane.qml +++ b/src/gui/Pages/Chat/RoomPane/RoomPane.qml @@ -9,6 +9,12 @@ MultiviewPane { saveName: "roomPane" edge: Qt.RightEdge + defaultSize: + (buttonRepeater.count - (roomPane.collapse ? 0 : 1)) * buttonWidth + + buttonWidth: + buttonRepeater.count >= 1 ? buttonRepeater.itemAt(1).implicitWidth : 0 + buttonsBackgroundColor: theme.chat.roomPane.topBar.background background: Rectangle { color: theme.chat.roomPane.background }