-
Notifications
You must be signed in to change notification settings - Fork 12
/
Info.qml
64 lines (55 loc) · 1.7 KB
/
Info.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
import QtQuick 2.0
Item {
id: id_root
property var currentDate: new Date()
property int fuelValue: 0
Timer {
id: timer
repeat: true
interval: 1000
running: true
onTriggered: id_root.currentDate = new Date()
}
Rectangle {
id: id_info
anchors.centerIn: parent
height: Math.min(id_root.width, id_root.height)
width: height
radius: width/2
color: "black"
border.color: "light green"
border.width: id_info.height * 0.02
Text {
id: id_date
anchors {
horizontalCenter: id_info.horizontalCenter
top: id_info.top
topMargin: id_info.height * 0.07
}
color: "light green"
font.pixelSize: id_info.height * 0.1
font.family: "Impact"
text: currentDate.getDate() + "/" + currentDate.getMonth() + "/" + currentDate.getFullYear()
}
Text {
id: id_clock
anchors {
horizontalCenter: id_info.horizontalCenter
top: id_date.bottom
topMargin: id_info.height * 0.01
}
color: "light green"
font.pixelSize: id_info.height * 0.1
font.family: "Impact"
text: currentDate.getHours() + ":" + currentDate.getMinutes() + ":" + currentDate.getSeconds()
}
Fuel {
x: id_info.height * 0.3
y: id_info.height * 0.35
width: id_info.height * 0.55
height: width
z: 1
value: id_root.fuelValue
}
}
}