~mpredotka/pulse-app/trunk

« back to all changes in this revision

Viewing changes to qml/GlobalStatComponent.qml

  • Committer: Michal Predotka
  • Date: 2016-03-23 14:47:21 UTC
  • Revision ID: mpredotka@gmail.com-20160323144721-y03htewq4cfxokyg
PathView works now

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.4
 
2
import Ubuntu.Components 1.3
 
3
 
 
4
 
 
5
Item {
 
6
    id: delegate_rect
 
7
 
 
8
    property string statTitle
 
9
    property string statResult
 
10
    property var statIcon
 
11
    property string statTime
 
12
    property string statDate
 
13
    scale: PathView.delegateScale
 
14
    opacity: PathView.delegateOpacity
 
15
    z: PathView.delegateZ
 
16
    width: root_globalstats.width - units.gu(4)
 
17
    height: root_globalstats.height - units.gu(4)
 
18
 
 
19
    UbuntuShape {
 
20
 
 
21
        color: "#fdd669"
 
22
        anchors.fill: parent
 
23
        aspect: UbuntuShape.DropShadow
 
24
 
 
25
        Label {
 
26
            id: stat_title_label
 
27
            color: "#0072b2"
 
28
            anchors{
 
29
                top: parent.top
 
30
                topMargin: units.gu(2)
 
31
                horizontalCenter: parent.horizontalCenter
 
32
            }
 
33
            text: statTitle
 
34
        }
 
35
 
 
36
        Column {
 
37
            anchors {
 
38
                bottom: parent.bottom
 
39
                bottomMargin: units.gu(2)
 
40
                left: parent.left
 
41
                right: parent.right
 
42
            }
 
43
            spacing: units.gu(1)
 
44
 
 
45
            Label {
 
46
                color: "#0072b2"
 
47
                text: statResult
 
48
                textSize: Label.XLarge
 
49
                anchors.horizontalCenter: parent.horizontalCenter
 
50
 
 
51
            }
 
52
 
 
53
 
 
54
            Icon {
 
55
                id: m_type_icon
 
56
 
 
57
                color: "#0072b2"
 
58
                source: Qt.resolvedUrl("../img/" + statIcon + ".svg")
 
59
                width: units.gu(3)
 
60
                height: width
 
61
                anchors.horizontalCenter: parent.horizontalCenter
 
62
            }
 
63
 
 
64
            Label {
 
65
                id: time_label
 
66
 
 
67
                color: "#0072b2"
 
68
                text: statTime
 
69
                anchors.horizontalCenter: parent.horizontalCenter
 
70
            }
 
71
 
 
72
            Label {
 
73
                id: date_label
 
74
 
 
75
                color: "#0072b2"
 
76
                text: statDate
 
77
                anchors.horizontalCenter: parent.horizontalCenter
 
78
            }
 
79
        }
 
80
    }
 
81
}