Size CreateRoom box correctly if window too small

This commit is contained in:
miruka 2019-11-08 10:31:07 -04:00
parent 37e6ced259
commit bfbeb83ce5
2 changed files with 8 additions and 2 deletions

View File

@ -53,6 +53,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap wrapMode: Text.Wrap
Layout.preferredWidth: parent.width
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: interfaceBox.verticalSpacing Layout.topMargin: interfaceBox.verticalSpacing
Layout.leftMargin: interfaceBox.horizontalSpacing Layout.leftMargin: interfaceBox.horizontalSpacing
@ -63,6 +64,7 @@ Rectangle {
id: interfaceBody id: interfaceBody
spacing: interfaceBox.verticalSpacing spacing: interfaceBox.verticalSpacing
Layout.preferredWidth: parent.width
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: Layout.topMargin:
interfaceTitle.visible ? 0 : interfaceBox.verticalSpacing interfaceTitle.visible ? 0 : interfaceBox.verticalSpacing
@ -76,6 +78,8 @@ Rectangle {
flow: width >= buttonRepeater.childrenImplicitWidth ? flow: width >= buttonRepeater.childrenImplicitWidth ?
GridLayout.LeftToRight : GridLayout.TopToBottom GridLayout.LeftToRight : GridLayout.TopToBottom
Layout.preferredWidth: parent.width
HRepeater { HRepeater {
id: buttonRepeater id: buttonRepeater
model: [] model: []

View File

@ -15,8 +15,10 @@ HPage {
HColumnLayout { HColumnLayout {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.minimumWidth: Layout.maximumWidth Layout.minimumWidth: Layout.maximumWidth
Layout.maximumWidth: Layout.maximumWidth: Math.min(
Math.max(tabBar.contentWidth, swipeView.contentWidth) parent.width,
Math.max(tabBar.contentWidth, swipeView.contentWidth),
)
HTabBar { HTabBar {
id: tabBar id: tabBar