-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCenterPanel.qml
More file actions
145 lines (130 loc) · 4.22 KB
/
Copy pathCenterPanel.qml
File metadata and controls
145 lines (130 loc) · 4.22 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import QtQuick
Item {
id: root
property string gear: "D"
property real fuelLevel: 68
property real coolantTemp: 92
property real odometer: 42815
property real tripDistance: 328.4
property color accentColor: "#00c896"
property color borderAccent: "#262d3d"
implicitWidth: 300
implicitHeight: 400
Rectangle {
anchors.fill: parent
radius: 14
color: "#0d1117"
border.color: root.borderAccent
border.width: 1.5
Behavior on border.color { ColorAnimation { duration: 400 } }
}
Column {
anchors.fill: parent
anchors.margins: 26
spacing: 20
Item {
width: parent.width
height: 88
Text {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
text: root.gear
color: "#ffffff"
font.family: "Bahnschrift"
font.pixelSize: 72
font.weight: Font.Light
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
text: "GEAR"
color: "#5a6378"
font.family: "Bahnschrift"
font.pixelSize: 9
font.letterSpacing: 1.5
font.weight: Font.Medium
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 20
Repeater {
model: ["P", "R", "N", "D", "S"]
Text {
text: modelData
color: modelData === root.gear ? "#ffffff" : "#3a4254"
font.family: "Bahnschrift"
font.pixelSize: 14
font.weight: modelData === root.gear ? Font.Medium : Font.Normal
}
}
}
Item { width: parent.width; height: 4 }
LinearGauge {
width: parent.width
label: "FUEL"
value: root.fuelLevel
maxValue: 100
units: "%"
warningLow: 15
accentColor: root.accentColor
}
LinearGauge {
width: parent.width
label: "COOLANT"
value: root.coolantTemp
maxValue: 130
units: "°C"
warningHigh: 110
accentColor: root.accentColor
}
Rectangle {
width: parent.width
height: 1
color: root.borderAccent
Behavior on color { ColorAnimation { duration: 400 } }
}
Column {
width: parent.width
spacing: 12
Row {
width: parent.width
Text {
text: "ODOMETER"
color: "#5a6378"
font.family: "Bahnschrift"
font.pixelSize: 9
font.letterSpacing: 1.5
}
Item { width: parent.width - x - odoVal.width; height: 1 }
Text {
id: odoVal
text: root.odometer.toLocaleString(Qt.locale("en_US"), 'f', 0) + " km"
color: "#e8eaed"
font.family: "Bahnschrift"
font.pixelSize: 15
font.weight: Font.Light
}
}
Row {
width: parent.width
Text {
text: "TRIP"
color: "#5a6378"
font.family: "Bahnschrift"
font.pixelSize: 9
font.letterSpacing: 1.5
}
Item { width: parent.width - x - tripVal.width; height: 1 }
Text {
id: tripVal
text: root.tripDistance.toFixed(1) + " km"
color: "#e8eaed"
font.family: "Bahnschrift"
font.pixelSize: 14
font.weight: Font.Light
}
}
}
}
}