-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathSettingsDialog.qml
191 lines (161 loc) · 4.06 KB
/
SettingsDialog.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3
import GeneralMagic 2.0
import Theme 1.0
import "./"
import "./SettingsPages"
ApplicationWindow {
id:root
width: 1300
height: 750
minimumHeight: 750
maximumHeight: 750
minimumWidth: 1300
maximumWidth: 1300
flags: Qt.Dialog
signal applyTheme(var mapInfo)
Shortcut {
sequence: "Ctrl+Q"
onActivated: Qt.quit()
}
Connections{
target: mainStack.currentItem
function onApplyTheme(mapInfo){
root.applyTheme(mapInfo)
}
}
Component{
id:quickControl
QuickControl{
}
}
Component{
id:autopilote
Autopilote{
}
}
Component{
id:display
Display{
}
}
Component{
id:driving
Driving{
}
}
Component{
id:light
Lights{
}
}
Component{
id:lock
Lock{
}
}
Component{
id:safety
SafetyAndSecurity{
}
}
Component{
id:service
Service{
}
}
Component{
id:mapSettings
MapThemes{
}
}
function switchPage(index){
switch(index){
case 0:
mainStack.replace(null,quickControl)
break;
case 1:
mainStack.replace(null,light)
break;
case 2:
mainStack.replace(null,lock)
break;
case 3:
mainStack.replace(null,display)
break;
case 4:
mainStack.replace(null,driving)
break;
case 5:
mainStack.replace(null,autopilote)
break;
case 6:
mainStack.replace(null,safety)
break;
case 7:
mainStack.replace(null,service)
break;
case 8:
mainStack.replace(null,mapSettings)
break;
}
}
SplitView {
id: splitView
anchors.fill: parent
orientation: Qt.Horizontal
handle: Item {
visible: false
}
Rectangle {
id: mainRect
color: Theme.isDarkMode ? "#161616" : "#FFFFFF"
SplitView.preferredWidth: 400
SplitView.maximumWidth: 400
SplitView.minimumWidth: 400
ListView{
id:listItemView
anchors.fill: parent
anchors.margins: 10
focus: true
spacing: 25 // Add spacing here between items
highlightFollowsCurrentItem :true
onCurrentIndexChanged: {
root.switchPage(currentIndex)
}
highlight: Item{
visible: false
}
model: SideListModel{}
delegate: SideListDelegate{
width: listItemView.width
lightIconRectIcon:iconName
darkIconRectIcon:iconName.replace(Qt.resolvedUrl("qrc:/Icons/Settings/"), Qt.resolvedUrl("qrc:/Icons/Settings/light/"));
iconRectColor: iconColor
spacing: 50
onClicked:{
ListView.view.currentIndex = index
root.switchPage(index)
}
}
}
}
Rectangle {
id: collapsibleRect
SplitView.fillWidth: true
color: Theme.isDarkMode ? "#0E0E0E" : "#F0F0F0"
clip: true
Loader{
id:mainLoader
anchors.fill: parent
StackView{
id:mainStack
anchors.fill: parent
initialItem:QuickControl{}
}
}
}
}
}