diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-04-03 20:41:06 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2018-04-04 14:59:15 -0700 |
commit | f391e5db0b0d96856279aec31ad6b1b8c920fda5 (patch) | |
tree | 07bb74924c20f372266f8a7a1bcd854446ece303 | |
parent | 928dd96f5225769d4af7354e75d4d245ae586884 (diff) |
homescreen: weather: use signal parameters over properties
Don't use property from libqtappfw framework but the passed signal parameters
Change-Id: Ide967c3b6aec52f54995e8263303e9cbbd8f99fb
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r-- | homescreen/qml/StatusArea.qml | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/homescreen/qml/StatusArea.qml b/homescreen/qml/StatusArea.qml index e464980..ab14a23 100644 --- a/homescreen/qml/StatusArea.qml +++ b/homescreen/qml/StatusArea.qml @@ -34,24 +34,23 @@ Item { target: weather onConditionChanged: { - var current_condition = weather.condition var icon = '' - if (current_condition.indexOf("clouds") != -1) { + if (condition.indexOf("clouds") != -1) { icon = "WeatherIcons_Cloudy-01.png" - } else if (current_condition.indexOf("thunderstorm") != -1) { + } else if (condition.indexOf("thunderstorm") != -1) { icon = "WeatherIcons_Thunderstorm-01.png" - } else if (current_condition.indexOf("snow") != -1) { + } else if (condition.indexOf("snow") != -1) { icon = "WeatherIcons_Snow-01.png" - } else if (current_condition.indexOf("rain") != -1) { + } else if (condition.indexOf("rain") != -1) { icon = "WeatherIcons_Rain-01.png" } - condition.source = icon ? './images/Weather/' + icon : '' + condition_item.source = icon ? './images/Weather/' + icon : '' } onTemperatureChanged: { - temperature.text = weather.temperature.split(".")[0] + '°F' + temperature_item.text = temperature.split(".")[0] + '°F' } } @@ -98,11 +97,11 @@ Item { Layout.fillHeight: true Layout.preferredHeight: 20 Image { - id: condition + id: condition_item source: './images/Weather/WeatherIcons_Rain-01.png' } Text { - id: temperature + id: temperature_item text: '64°F' color: 'white' font.family: 'Helvetica' |