Standard way of knowing if window "is wide"
This commit is contained in:
@@ -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)
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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()
|
||||
|
@@ -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
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user