diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-03-13 12:56:17 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-03-13 14:47:20 +0000 |
commit | 1f989828a9a9b02e1e20da77803fec9c7e184dda (patch) | |
tree | 5c38c0f33be1b46695eb8c19f42d30e4b1368131 /examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml | |
parent | d1ac6e3dc8b6919bcba4278a4cef8cbfa83f30a1 (diff) |
Wearable: remove unnecessary wrapper items
Almost all pages were centering a fixed-size SwipeView. If the window
was larger than assumed, swipes would only work in the center are of
the window. Therefore it's better to stretch the view, and just center
the content instead. This way swipes work consistently in the whole
content area of the page.
Change-Id: Idc2a2bc327a49314cbf1271fa34b74df5f633ed8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml')
-rw-r--r-- | examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml | 99 |
1 files changed, 46 insertions, 53 deletions
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml b/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml index 95df2676..09b54bd2 100644 --- a/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml +++ b/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml @@ -53,70 +53,63 @@ import "../Style" import "navigation.js" as NavigationData Item { - Item { - anchors.centerIn: parent + Column { + anchors.fill: parent + spacing: 2 - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight + Rectangle { + id: titleRowCntr - Column { - anchors.fill: parent - spacing: 2 + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width + height: 64 - Rectangle { - id: titleRowCntr + color: UIStyle.colorQtGray9 - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - height: 64 + Row { + spacing: 10 + anchors.centerIn: parent - color: UIStyle.colorQtGray9 - - Row { - spacing: 10 - anchors.centerIn: parent - - Image { - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "images/route.png" - fillMode: Image.PreserveAspectCrop - } - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Walking") - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 2 - color: UIStyle.colorQtGray2 - } + Image { + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "images/route.png" + fillMode: Image.PreserveAspectCrop + } + Text { + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Walking") + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 2 + color: UIStyle.colorQtGray2 } } + } - ListModel { - id: routeModel - } + ListModel { + id: routeModel + } - ListView { - id: routeView + ListView { + id: routeView - width: parent.width - height: UIStyle.visibleRectHeight - titleRowCntr.height - property var imageList: ["straight.png", - "leftturn.png", - "rightturn.png", - "uturn.png", - "start.png", - "end.png"] + width: parent.width + height: UIStyle.visibleRectHeight - titleRowCntr.height + property var imageList: ["straight.png", + "leftturn.png", + "rightturn.png", + "uturn.png", + "start.png", + "end.png"] - clip: true - focus: true - boundsBehavior: Flickable.StopAtBounds - snapMode: ListView.SnapToItem - currentIndex: 0 - model: routeModel - delegate: RouteElement {} - } + clip: true + focus: true + boundsBehavior: Flickable.StopAtBounds + snapMode: ListView.SnapToItem + currentIndex: 0 + model: routeModel + delegate: RouteElement {} } } Component.onCompleted: { |