-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathWaterTile.qml
103 lines (88 loc) · 2.06 KB
/
WaterTile.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import QtQuick 2.1
import qb.components 1.0
import BasicUIControls 1.0;
Tile {
id: root
property bool dimState: screenStateController.dimmedColors
property int flow: app.waterflow
property int quan: app.waterquantity
property int day: app.todayValue
property bool updateAvailable: app.updateAvailable
property bool tempDomMode: app.domMode
onClicked: {
stage.openFullscreen(app.waterConfigScreenUrl)
}
Component.onCompleted: {
app.waterUpdated.connect(updateWater)
}
function updateWater(){
flow = app.waterflow
quan = app.waterquantity
day = app.todayValue
updateAvailable = app.updateAvailable
tempDomMode= app.domMode
}
Text {
id: tileTitle
anchors {
baseline: parent.top
baselineOffset: 30
horizontalCenter: parent.horizontalCenter
}
font {
family: qfont.regular.name
pixelSize: qfont.tileTitle
}
color: !dimState? "black" : "white"
text: "Water"
}
Text {
id: curFlow
text: "Flow nu: " + flow + " l/m"
color: !dimState? "black" : "white"
anchors {
top: tileTitle.bottom
topMargin: isNxt? 5:4
horizontalCenter: parent.horizontalCenter
}
font.pixelSize: isNxt? 22:18
font.family: qfont.bold.name
}
Text {
id: dayQuantity
text: "Vandaag: " + parseFloat(day) + " l"
color: !dimState? "black" : "white"
anchors {
top: curFlow.bottom
topMargin: 1
horizontalCenter: parent.horizontalCenter
}
font.pixelSize: isNxt? 22:18
font.family: qfont.bold.name
}
Text {
id: totalQuantity
text: "Totaal: " + parseFloat(quan/1000).toFixed(3) + " m3"
color: !dimState? "black" : "white"
anchors {
top: dayQuantity.bottom
topMargin: 1
horizontalCenter: parent.horizontalCenter
}
font.pixelSize: isNxt? 22:18
font.family: qfont.bold.name
}
Text {
id: updateAvailable1
text: "ESP Update beschikbaar"
color: !dimState? "black" : "white"
anchors {
top: totalQuantity.bottom
topMargin: 5
horizontalCenter: parent.horizontalCenter
}
font.pixelSize: isNxt? 22:18
font.family: qfont.bold.name
visible: !tempDomMode & updateAvailable
}
}