← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~vthompson/ubuntu-weather-app/reboot-add-condition-text into lp:ubuntu-weather-app/reboot

 

Victor Thompson has proposed merging lp:~vthompson/ubuntu-weather-app/reboot-add-condition-text into lp:ubuntu-weather-app/reboot.

Commit message:
Add conditions text to day delegate.

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

For more details, see:
https://code.launchpad.net/~vthompson/ubuntu-weather-app/reboot-add-condition-text/+merge/263306

Add conditions text to day delegate.
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~vthompson/ubuntu-weather-app/reboot-add-condition-text into lp:ubuntu-weather-app/reboot.
=== modified file 'app/components/DayDelegate.qml'
--- app/components/DayDelegate.qml	2015-06-21 14:02:58 +0000
+++ app/components/DayDelegate.qml	2015-06-30 00:48:03 +0000
@@ -31,7 +31,8 @@
     property alias high: highLabel.text
     property alias low: lowLabel.text
 
-    property alias chanceOfRain: chanceOfRainForecast.chance
+    property alias condition: conditionForecast.text
+    property alias chanceOfRain: chanceOfRainForecast.value
     property alias humidity: humidityForecast.value
     property alias pollen: pollenForecast.value
     property alias sunrise: sunriseForecast.value
@@ -186,15 +187,17 @@
 
             // Overview text
             Label {
-                id: chanceOfRainForecast
+                id: conditionForecast
                 color: UbuntuColors.coolGrey
                 fontSize: "x-large"
                 horizontalAlignment: Text.AlignHCenter
-                text: i18n.tr("Chance of rain")
                 width: parent.width
-                visible: false  // FIXME: add overview text eg "Chance of flurries"
+            }
 
-                property int chance: 0
+            ForecastDetailsDelegate {
+                id: chanceOfRainForecast
+                forecast: i18n.tr("Chance of rain")
+                imageSource: "../graphics/extended-information_chance-of-rain.svg"
             }
 
             ForecastDetailsDelegate {

=== modified file 'app/components/ForecastDetailsDelegate.qml'
--- app/components/ForecastDetailsDelegate.qml	2015-06-21 15:02:05 +0000
+++ app/components/ForecastDetailsDelegate.qml	2015-06-30 00:48:03 +0000
@@ -38,7 +38,7 @@
     Label {
         id: forecastLabel
         elide: Text.ElideRight
-        width: units.gu(8)
+        width: units.gu(14)
     }
     
     Label {

=== modified file 'app/ui/LocationPane.qml'
--- app/ui/LocationPane.qml	2015-06-21 14:02:58 +0000
+++ app/ui/LocationPane.qml	2015-06-30 00:48:03 +0000
@@ -97,7 +97,8 @@
                     low: Math.round(forecasts[x][tempUnits].tempMin).toString() + settings.tempScale,
                     high: (forecasts[x][tempUnits].tempMax !== undefined) ? Math.round(forecasts[x][tempUnits].tempMax).toString() + settings.tempScale : "",
                     image: (forecasts[x].icon !== undefined && iconMap[forecasts[x].icon] !== undefined) ? iconMap[forecasts[x].icon] : "",
-                    chanceOfRain: forecasts[x].propPrecip === undefined ? -1 : forecasts[x].propPrecip,
+                    condition: emptyIfUndefined(forecasts[x].condition),
+                    chanceOfRain: emptyIfUndefined(forecasts[x].propPrecip, "%"),
                     humidity: emptyIfUndefined(forecasts[x].humidity, "%"),
                     uvIndex: emptyIfUndefined(forecasts[x].uv),
                     wind: forecasts[x][tempUnits].windSpeed === undefined || forecasts[x].windDir === undefined
@@ -181,6 +182,7 @@
                 image: model.image
                 low: model.low
 
+                condition: model.condition
                 chanceOfRain: model.chanceOfRain
                 humidity: model.humidity
                 // TODO: extra from API