← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~nik90/ubuntu-weather-app/homehourly-design-fix into lp:ubuntu-weather-app/reboot

 

Nekhelesh Ramananthan has proposed merging lp:~nik90/ubuntu-weather-app/homehourly-design-fix into lp:ubuntu-weather-app/reboot.

Commit message:
Simplified HomeHourly.qml structure and fixed background issue.

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)

For more details, see:
https://code.launchpad.net/~nik90/ubuntu-weather-app/homehourly-design-fix/+merge/255412

In lp:~ahayzen/ubuntu-weather-app/reboot-day-delegate-expand I noticed that the hourly forecast had a different background color as can be seen in https://imgur.com/NMRuJvR. I fixed that in this MP.

Also I noticed that HomeHourly.qml was structured as,

Item {
  ListView {
  }
}

Where the Item{} is not required. I removed that as it is recommended to keep the delegate of a listview as simple as possible with least number of overlapping elements.
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~nik90/ubuntu-weather-app/homehourly-design-fix into lp:ubuntu-weather-app/reboot.
=== modified file 'app/components/HomeHourly.qml'
--- app/components/HomeHourly.qml	2015-03-19 10:21:28 +0000
+++ app/components/HomeHourly.qml	2015-04-07 19:32:42 +0000
@@ -18,75 +18,80 @@
 
 import QtQuick 2.3
 import Ubuntu.Components 1.1
-import Ubuntu.Components.ListItems 0.1 as ListItem
-import QtGraphicalEffects 1.0
 
-Item {
+ListView {
     id: homeHourly
 
+    width: parent ? parent.width : undefined
+    height: parent ? parent.height : undefined
+    model: forecasts.length
+    orientation: ListView.Horizontal
+    clip:true
+
     onVisibleChanged: {
         if(visible) {
             ListView.model = forecasts.length
         }
     }
 
-    ListView {
-        id: hourlyForecasts
-        width:parent.width
-        height:parent.height
-        model: forecasts.length
-        orientation: ListView.Horizontal
-        clip:true
-        MouseArea {
-            anchors.fill: parent
-            onClicked: {
-                homeGraphic.visible = true
+    MouseArea {
+        anchors.fill: parent
+        onClicked: {
+            homeGraphic.visible = true
+        }
+    }
+
+    delegate: Item {
+        id: delegate
+
+        property var hourData: forecasts[index]
+
+        width: childrenRect.width
+        height: parent.height
+
+        Column {
+            id: hourColumn
+            width: units.gu(10)
+            height: childrenRect.height
+            anchors.verticalCenter: parent.verticalCenter
+
+            Label {
+                text: formatTimestamp(hourData.date, 'ddd')+" "+formatTime(hourData.date, 'h:mm')
+                fontSize: "small"
+                font.weight: Font.Light
+                anchors.horizontalCenter: parent.horizontalCenter
             }
-        }
-        delegate: Rectangle {
-            width: childrenRect.width
-            height: parent.height
-            property var hourData: forecasts[index]
-            Column {
-                id: hourColumn
-                width: units.gu(10)
-                height: childrenRect.height
-                anchors.verticalCenter: parent.verticalCenter
-                Label {
-                    text: formatTimestamp(hourData.date, 'ddd')+" "+formatTime(hourData.date, 'h:mm')
-                    fontSize: "small"
-                    font.weight: Font.Light
-                    anchors.horizontalCenter: parent.horizontalCenter
-                }
-                Item {
-                    width: units.gu(7)
-                    height: units.gu(7)
-                    anchors.horizontalCenter: parent.horizontalCenter
-                    Icon {
-                        anchors {
-                            fill: parent
-                            margins: units.gu(0.5)
-                        }
-                        color: UbuntuColors.orange
-                        name: (hourData.icon !== undefined && iconMap[hourData.icon] !== undefined) ? iconMap[hourData.icon] : ""
+
+            Item {
+                width: units.gu(7)
+                height: units.gu(7)
+                anchors.horizontalCenter: parent.horizontalCenter
+                Icon {
+                    anchors {
+                        fill: parent
+                        margins: units.gu(0.5)
                     }
-                }
-                Label {
-                    font.pixelSize: units.gu(3)
-                    font.weight: Font.Light
-                    anchors.horizontalCenter: parent.horizontalCenter
-                    text: Math.round(hourData[tempUnits].temp).toString()+settings.tempScale
-                }
-
-            }
-            Rectangle {
-                anchors.verticalCenter: parent.verticalCenter
-                color: UbuntuColors.darkGrey
-                height: hourColumn.height
-                opacity: 0.2
-                visible: index > 0
-                width: units.gu(0.1)
-            }
+                    color: UbuntuColors.orange
+                    name: (hourData.icon !== undefined && iconMap[hourData.icon] !== undefined) ? iconMap[hourData.icon] : ""
+                }
+            }
+
+            Label {
+                font.pixelSize: units.gu(3)
+                font.weight: Font.Light
+                anchors.horizontalCenter: parent.horizontalCenter
+                text: Math.round(hourData[tempUnits].temp).toString()+settings.tempScale
+            }
+        }
+
+        Rectangle {
+            anchors.verticalCenter: parent.verticalCenter
+            color: UbuntuColors.darkGrey
+            height: hourColumn.height
+            opacity: 0.2
+            visible: index > 0
+            width: units.gu(0.1)
         }
     }
 }
+

=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot	2015-04-04 07:59:32 +0000
+++ po/com.ubuntu.weather.pot	2015-04-07 19:32:42 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: ubuntu-weather-app\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-04-04 09:58+0200\n"
+"POT-Creation-Date: 2015-04-07 21:16+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"


References