-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.qml
161 lines (144 loc) · 4.77 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import QtQuick 2.9
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import Style 1.0
import QtGraphicalEffects 1.15
import "Components"
import "qrc:/LayoutManager.js" as Responsive
ApplicationWindow {
id: root
width: 1920
height: 1200
maximumHeight: height
minimumHeight: height
maximumWidth: width
minimumWidth: width
visible: true
title: qsTr("Tesla Model 3")
onWidthChanged: {
if(adaptive)
adaptive.updateWindowWidth(root.width)
}
onHeightChanged: {
if(adaptive)
adaptive.updateWindowHeight(root.height)
}
property var adaptive: new Responsive.AdaptiveLayoutManager(root.width,root.height, root.width,root.height)
FontLoader {
id: uniTextFont
source: "qrc:/Fonts/Unitext Regular.ttf"
}
background: Loader {
anchors.fill: parent
sourceComponent: Style.mapAreaVisible ? backgroundRect : backgroundImage
}
Header {
z: 99
id: headerLayout
}
footer: Footer{
id: footerLayout
onOpenLauncher: launcher.open()
}
TopLeftButtonIconColumn {
z: 99
anchors.left: parent.left
anchors.top: headerLayout.bottom
anchors.leftMargin: 18
}
RowLayout {
id: mapLayout
visible: Style.mapAreaVisible
spacing: 0
anchors.fill: parent
Item {
Layout.preferredWidth: 620
Layout.fillHeight: true
Image {
anchors.centerIn: parent
source: Style.isDark ? "qrc:/icons/light/sidebar.png" : "qrc:/icons/dark/sidebar-light.png"
}
}
NavigationMapHelperScreen {
Layout.fillWidth: true
Layout.fillHeight: true
runMenuAnimation: true
}
}
LaunchPadControl {
id: launcher
y: (root.height - height) / 2 + (footerLayout.height)
x: (root.width - width ) / 2
}
Component {
id: backgroundRect
Rectangle {
color: "#171717"
anchors.fill: parent
}
}
Component {
id: backgroundImage
Image {
source: Style.getImageBasedOnTheme()
Icon {
icon.source: Style.isDark ? "qrc:/icons/car_action_icons/dark/lock.svg" : "qrc:/icons/car_action_icons/lock.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: - 350
anchors.horizontalCenterOffset: 37
}
Icon {
icon.source: Style.isDark ? "qrc:/icons/car_action_icons/dark/Power.svg" : "qrc:/icons/car_action_icons/Power.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: - 77
anchors.horizontalCenterOffset: 550
}
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: - 230
anchors.horizontalCenterOffset: 440
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
text: "Trunk"
font.family: "Inter"
font.pixelSize: 14
font.bold: Font.DemiBold
color: Style.black20
}
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
text: "Open"
font.family: "Inter"
font.pixelSize: 16
font.bold: Font.Bold
color: Style.isDark ? Style.white : "#171717"
}
}
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: - 180
anchors.horizontalCenterOffset: - 350
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
text: "Frunk"
font.family: "Inter"
font.pixelSize: 14
font.bold: Font.DemiBold
color: Style.black20
}
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
text: "Open"
font.family: "Inter"
font.pixelSize: 16
font.bold: Font.Bold
color: Style.isDark ? Style.white : "#171717"
}
}
}
}
}