From a3e2233391f05a2c7754d6c8ca342e1b7544a192 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 18 Jul 2019 23:59:05 -0400 Subject: [PATCH] Fix window/content sizes for EditAccount page --- src/qml/Pages/EditAccount/EditAccount.qml | 2 +- src/qml/Pages/EditAccount/Profile.qml | 2 +- src/qml/Theme.qml | 2 +- src/qml/UI.qml | 1 + src/qml/Window.qml | 1 - 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qml/Pages/EditAccount/EditAccount.qml b/src/qml/Pages/EditAccount/EditAccount.qml index 87246b7f..2c848eb1 100644 --- a/src/qml/Pages/EditAccount/EditAccount.qml +++ b/src/qml/Pages/EditAccount/EditAccount.qml @@ -26,7 +26,7 @@ HPage { Layout.maximumWidth: Math.min(parent.width, 640) Layout.preferredWidth: - window.isWide ? parent.width : avatarPreferredSize + pageStack.isWide ? parent.width : avatarPreferredSize Layout.preferredHeight: childrenRect.height diff --git a/src/qml/Pages/EditAccount/Profile.qml b/src/qml/Pages/EditAccount/Profile.qml index 48daff6b..7713de8c 100644 --- a/src/qml/Pages/EditAccount/Profile.qml +++ b/src/qml/Pages/EditAccount/Profile.qml @@ -45,7 +45,7 @@ HGridLayout { } columns: 2 - flow: window.isWide ? GridLayout.LeftToRight : GridLayout.TopToBottom + flow: pageStack.isWide ? GridLayout.LeftToRight : GridLayout.TopToBottom rowSpacing: currentSpacing Component.onCompleted: nameField.field.forceActiveFocus() diff --git a/src/qml/Theme.qml b/src/qml/Theme.qml index f945fa20..0c352d7c 100644 --- a/src/qml/Theme.qml +++ b/src/qml/Theme.qml @@ -9,7 +9,7 @@ QtObject { property int minimumSupportedWidth: 240 property int minimumSupportedHeight: 120 - property int isWideAbove: 599 + property int contentIsWideAbove: 439 property int minimumSupportedWidthPlusSpacing: 240 + spacing * 2 property int minimumSupportedHeightPlusSpacing: 120 + spacing * 2 diff --git a/src/qml/UI.qml b/src/qml/UI.qml index 582ca6eb..3cba8687 100644 --- a/src/qml/UI.qml +++ b/src/qml/UI.qml @@ -58,6 +58,7 @@ Item { StackView { id: pageStack + property bool isWide: width > theme.contentIsWideAbove function showPage(name, properties={}) { pageStack.replace("Pages/" + name + ".qml", properties) diff --git a/src/qml/Window.qml b/src/qml/Window.qml index 23b20c6d..174ae870 100644 --- a/src/qml/Window.qml +++ b/src/qml/Window.qml @@ -26,7 +26,6 @@ ApplicationWindow { property bool debug: false property bool ready: false - property bool isWide: width > theme.isWideAbove // Note: window.settingsChanged() must be called manually property var settings: ({})