Standard way of knowing if window "is wide"

This commit is contained in:
miruka
2019-07-18 01:18:06 -04:00
parent 902ac250b0
commit fa61e8f0e3
6 changed files with 16 additions and 16 deletions

View File

@@ -16,8 +16,6 @@ SwipeView {
property alias headerLabel: innerHeaderLabel
property var hideHeaderUnderHeight: null
property bool wide: width > 414 + leftPadding + rightPadding
property int currentSpacing:
Math.min(theme.spacing * width / 400, theme.spacing * 2)

View File

@@ -26,7 +26,7 @@ HPage {
Layout.maximumWidth: Math.min(parent.width, 640)
Layout.preferredWidth:
wide ? parent.width : avatarPreferredSize
window.isWide ? parent.width : avatarPreferredSize
Layout.preferredHeight: childrenRect.height

View File

@@ -33,7 +33,7 @@ HGridLayout {
}
columns: 2
flow: wide ? GridLayout.LeftToRight : GridLayout.TopToBottom
flow: window.isWide ? GridLayout.LeftToRight : GridLayout.TopToBottom
rowSpacing: currentSpacing
Component.onCompleted: nameField.field.forceActiveFocus()

View File

@@ -8,6 +8,7 @@ QtObject {
property int minimumSupportedWidth: 240
property int minimumSupportedHeight: 120
property int isWideAbove: 599
property int minimumSupportedWidthPlusSpacing: 240 + spacing * 2
property int minimumSupportedHeightPlusSpacing: 120 + spacing * 2

View File

@@ -18,6 +18,7 @@ ApplicationWindow {
property bool debug: false
property bool ready: false
property bool isWide: width > theme.isWideAbove
Component.onCompleted: {
Qt.application.organization = "harmonyqml"