From c19e8d5c88d9cd1d95de485c78e6919644addad8 2014-11-28 08:28:00 From: Titta Heikkala Date: 2014-11-28 08:28:00 Subject: [PATCH] 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 --- diff --git a/examples/charts/qmlweather/qml/qmlweather/main.qml b/examples/charts/qmlweather/qml/qmlweather/main.qml index 21bbccb..0f5f9d2 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" }