-
Notifications
You must be signed in to change notification settings - Fork 1
/
NlalertDelegate.qml
74 lines (67 loc) · 1.34 KB
/
NlalertDelegate.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
import QtQuick 2.1
import qb.components 1.0
Rectangle {
function colorDistance(distance) {
if (distance > app.nlalertRegioRange) {
return "#00FF00"
} else {
return "#FF0000"
}
}
width: isNxt ? 850 : 646
height: isNxt ? 94 : 73
color: colors.background
Text {
id: txtAlertTime
x: 10
anchors {
top: parent.top
left: parent.left
leftMargin: 5
}
text: alertTime
font.family: qfont.semiBold.name
font.pixelSize: isNxt ? 20 : 16
}
/* Text {
id: txtAlertLocation
anchors.left: txtAlertTime.right
anchors.leftMargin: 10
anchors.right: txtDistance.left
anchors.rightMargin: 10
anchors.bottom: txtAlertTime.bottom
clip: true
text: alertLocation
font.family: qfont.semiBold.name
font.pixelSize: isNxt ? 20 : 16
}
Text {
id: txtDistance
anchors {
top: parent.top
right: parent.right
rightMargin: 5
}
text: " " + distance + " km"
font.family: qfont.semiBold.name
font.pixelSize: isNxt ? 20 : 16
color: colorDistance(distance)
}
*/
Text {
id:txtDescription
x: 10
anchors {
top: txtAlertTime.bottom
left: txtAlertTime.left
}
width: parent.width -10
text: description
wrapMode: Text.WordWrap
maximumLineCount: 3
elide: Text.ElideRight
lineHeight: 0.8
font.family: qfont.italic.name
font.pixelSize: isNxt ? 18 : 14
}
}