diff options
author | Titta Heikkala <titta.heikkala@theqtcompany.com> | 2014-11-28 10:15:17 +0200 |
---|---|---|
committer | Titta Heikkala <titta.heikkala@theqtcompany.com> | 2014-11-28 10:28:00 +0200 |
commit | c19e8d5c88d9cd1d95de485c78e6919644addad8 (patch) | |
tree | 3ecd57c7853910dc7e4550c800254cfb95adc105 /examples/charts | |
parent | a803e4e9381b66fe6dd6727581b685f5569d531d (diff) |
Improve QML Weather example layout
The size of the images is adjusted based on the window size.
Change-Id: Ib575288456d6773e00ee740b7b0be6a392c9eeaa
Task-number: QTRD-3444
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'examples/charts')
-rw-r--r-- | examples/charts/qmlweather/qml/qmlweather/main.qml | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/examples/charts/qmlweather/qml/qmlweather/main.qml b/examples/charts/qmlweather/qml/qmlweather/main.qml index 21bbccb0..0f5f9d21 100644 --- a/examples/charts/qmlweather/qml/qmlweather/main.qml +++ b/examples/charts/qmlweather/qml/qmlweather/main.qml @@ -32,8 +32,8 @@ Rectangle { id: chartView title: "Weather forecast" //![1] + height: parent.height / 4 * 3 anchors.top: parent.top - anchors.bottom: weatherImageRow.top anchors.left: parent.left anchors.right: parent.right legend.alignment: Qt.AlignTop @@ -126,12 +126,12 @@ Rectangle { Row { id: weatherImageRow + anchors.top: chartView.bottom + anchors.topMargin: 5 anchors.bottom: poweredByText.top - anchors.bottomMargin: 10 - anchors.left: parent.left - anchors.leftMargin: 25 - anchors.right: parent.right - anchors.rightMargin: 25 + anchors.bottomMargin: 5 + anchors.horizontalCenter: parent.horizontalCenter + height: parent.height - chartView.height - anchors.topMargin ListModel { id: weatherImageModel @@ -142,7 +142,7 @@ Rectangle { model: weatherImageModel delegate: Image { source: imageSource - width: weatherImageRow.width / weatherImageModel.count + width: weatherImageRow.height height: width fillMode: Image.PreserveAspectCrop } @@ -152,9 +152,10 @@ Rectangle { Text { id: poweredByText anchors.bottom: parent.bottom - anchors.bottomMargin: 10 + anchors.bottomMargin: 5 anchors.left: parent.left anchors.leftMargin: 25 + height: parent.height / 25 text: "Powered by World Weather Online" } |