~ahayzen/ubuntu-weather-app/transparent-legacy-listitems

« back to all changes in this revision

Viewing changes to app/components/DayDelegateExtraInfo.qml

* Split day delegate extra info into a separate component that is loaded on demand
* Use ListView per Location Pane so that scrolling vertically only affect the currently focused pane.

Approved by Ubuntu Phone Apps Jenkins Bot, Victor Thompson.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical Ltd
 
3
 *
 
4
 * This file is part of Ubuntu Weather App
 
5
 *
 
6
 * Ubuntu Weather App is free software: you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License version 3 as
 
8
 * published by the Free Software Foundation.
 
9
 *
 
10
 * Ubuntu Weather App is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
import QtQuick 2.4
 
20
import Ubuntu.Components 1.2
 
21
 
 
22
 
 
23
Column {
 
24
    id: extraInfoColumn
 
25
    anchors {
 
26
        centerIn: parent
 
27
    }
 
28
    spacing: units.gu(2)
 
29
 
 
30
    // FIXME: extended-infomation_* aren't actually on device
 
31
 
 
32
    // Overview text
 
33
    Label {
 
34
        id: conditionForecast
 
35
        color: UbuntuColors.coolGrey
 
36
        font.capitalization: Font.Capitalize
 
37
        fontSize: "x-large"
 
38
        horizontalAlignment: Text.AlignHCenter
 
39
        text: modelData.condition
 
40
        width: parent.width
 
41
    }
 
42
 
 
43
    ForecastDetailsDelegate {
 
44
        id: chanceOfRainForecast
 
45
        forecast: i18n.tr("Chance of rain")
 
46
        imageSource: "../graphics/extended-information_chance-of-rain.svg"
 
47
        value: modelData.chanceOfRain
 
48
    }
 
49
 
 
50
    ForecastDetailsDelegate {
 
51
        id: windForecast
 
52
        forecast: i18n.tr("Winds")
 
53
        imageSource: "../graphics/extended-information_wind.svg"
 
54
        value: modelData.wind
 
55
    }
 
56
 
 
57
    ForecastDetailsDelegate {
 
58
        id: uvIndexForecast
 
59
        imageSource: "../graphics/extended-information_uv-level.svg"
 
60
        forecast: i18n.tr("UV Index")
 
61
        value: modelData.uvIndex
 
62
    }
 
63
 
 
64
    ForecastDetailsDelegate {
 
65
        id: pollenForecast
 
66
        forecast: i18n.tr("Pollen")
 
67
        // FIXME: need icon
 
68
        //value: modelData.pollen  // TODO: extra from API
 
69
    }
 
70
 
 
71
    ForecastDetailsDelegate {
 
72
        id: humidityForecast
 
73
        forecast: i18n.tr("Humidity")
 
74
        imageSource: "../graphics/extended-information_humidity.svg"
 
75
        value: modelData.humidity
 
76
    }
 
77
 
 
78
    ForecastDetailsDelegate {
 
79
        id: sunriseForecast
 
80
        forecast: i18n.tr("Sunrise")
 
81
        imageSource: "../graphics/extended-information_sunrise.svg"
 
82
        value: modelData.sunrise
 
83
    }
 
84
 
 
85
    ForecastDetailsDelegate {
 
86
        id: sunsetForecast
 
87
        forecast: i18n.tr("Sunset")
 
88
        imageSource: "../graphics/extended-information_sunset.svg"
 
89
        value: modelData.sunset
 
90
    }
 
91
}