From bfbeb83ce59478366e0ff5a50e83501922d3c429 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 8 Nov 2019 10:31:07 -0400 Subject: [PATCH] Size CreateRoom box correctly if window too small --- src/qml/Base/HBox.qml | 4 ++++ src/qml/Pages/AddChat/AddChat.qml | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qml/Base/HBox.qml b/src/qml/Base/HBox.qml index d07fd310..3080a34c 100644 --- a/src/qml/Base/HBox.qml +++ b/src/qml/Base/HBox.qml @@ -53,6 +53,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap + Layout.preferredWidth: parent.width Layout.fillWidth: true Layout.topMargin: interfaceBox.verticalSpacing Layout.leftMargin: interfaceBox.horizontalSpacing @@ -63,6 +64,7 @@ Rectangle { id: interfaceBody spacing: interfaceBox.verticalSpacing + Layout.preferredWidth: parent.width Layout.fillWidth: true Layout.topMargin: interfaceTitle.visible ? 0 : interfaceBox.verticalSpacing @@ -76,6 +78,8 @@ Rectangle { flow: width >= buttonRepeater.childrenImplicitWidth ? GridLayout.LeftToRight : GridLayout.TopToBottom + Layout.preferredWidth: parent.width + HRepeater { id: buttonRepeater model: [] diff --git a/src/qml/Pages/AddChat/AddChat.qml b/src/qml/Pages/AddChat/AddChat.qml index 0ef64f1b..ca636ced 100644 --- a/src/qml/Pages/AddChat/AddChat.qml +++ b/src/qml/Pages/AddChat/AddChat.qml @@ -15,8 +15,10 @@ HPage { HColumnLayout { Layout.alignment: Qt.AlignCenter Layout.minimumWidth: Layout.maximumWidth - Layout.maximumWidth: - Math.max(tabBar.contentWidth, swipeView.contentWidth) + Layout.maximumWidth: Math.min( + parent.width, + Math.max(tabBar.contentWidth, swipeView.contentWidth), + ) HTabBar { id: tabBar