forked from alex-adam/Tesla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
143 lines (125 loc) · 3.71 KB
/
main.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
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
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
ApplicationWindow {
title: qsTr("Tesla Model S Speedometer")
width: 1400
height: 600
visible: true
color: "black"
LeftElement {
y: 50
width: parent.width / 2
height: 450
}
RightElement {
id: rightRect
y: 50
x: parent.width / 2
width: parent.width / 2
height: 475
}
QtObject {
property var locale: Qt.locale()
property date currentDate: new Date()
property string dateString
property string timeString
Component.onCompleted: {
dateString = currentDate.toLocaleDateString();
timeString = currentDate.toLocaleTimeString();
}
}
Image {
width: parent.width
height: parent.height
source: "/pics/Background.png"
}
//Leiste unten
Rectangle {
y: parent.height - 90
height: 200
width: parent.width
color: "transparent"
RowLayout {
y: 50
x: 200
Text {
text: "245"
font.pixelSize: 20
font.bold: true
color: "white"
}
Text {
text: "mi"
font.pixelSize: 20
font.bold: false
color: "darkgray"
}
}
RowLayout {
y: 50
x: 350
Text {
text: "69º"
font.pixelSize: 20
font.bold: true
color: "white"
}
Text {
text: "F"
font.pixelSize: 20
font.bold: false
color: "darkgray"
}
}
RowLayout {
y: 50
x: 950
Text {
text: new Date().toLocaleDateString(Qt.locale(),"ddd") //ddd MMM d //h:mm AP
font.pixelSize: 20
font.bold: true
color: "white"
}
Text {
text: new Date().toLocaleDateString(Qt.locale(),"MMM d") //ddd MMM d //h:mm AP
font.pixelSize: 20
font.bold: false
color: "darkgray"
}
}
RowLayout {
y: 50
x: 1100
Text {
text: new Date().toLocaleTimeString(Qt.locale(),"h:mm") //ddd MMM d //h:mm AP
font.pixelSize: 20
font.bold: false
color: "darkgray"
}
Text {
text: new Date().toLocaleTimeString(Qt.locale(),"AP") //ddd MMM d //h:mm AP
font.pixelSize: 20
font.bold: true
color: "white"
}
}
}
//Tacho
Image {
height: parent.height
width: height
x: (parent.width / 2) - (width / 2)
scale: 1.14
source: "/pics/Tacho.png"
fillMode: Image.PreserveAspectFit
}
Speedometer {
height: 525
width: height
x: (parent.width / 2) - (width / 2)
y: (parent.height / 2) - (height / 2)
}
}