Skip to content

Commit 5387ffb

Browse files
authored
Merge pull request #1 from cppqtdev/Tesla
Tesla UI Design Using QT QML with wether , Music , Map Added
2 parents a2a84cf + 7f952d8 commit 5387ffb

File tree

245 files changed

+9002
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+9002
-1
lines changed

Component/LabelSelector.qml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import QtQuick 2.15
2+
import QtQuick.Layouts 1.3
3+
import QtQuick.Controls 2.5
4+
5+
import Theme 1.0
6+
7+
8+
Pane{
9+
id:control
10+
padding: 0
11+
leftInset: 0
12+
rightInset: 0
13+
property string setColors: Theme.isDarkMode ? "grey" : "#FFFFFF"
14+
property real radius: implicitHeight / 2
15+
property int allowMaxTags: 5
16+
property var lableList: ["Lable","Lable","Lable"]
17+
implicitWidth: layout.implicitWidth
18+
implicitHeight: 60
19+
20+
background: Rectangle{
21+
implicitHeight: control.implicitHeight
22+
implicitWidth: control.implicitWidth
23+
color: Theme.isDarkMode ? "#1c1d21" : "Grey"
24+
radius: control.radius
25+
}
26+
27+
RowLayout{
28+
id:layout
29+
spacing: 0
30+
anchors{
31+
verticalCenter: parent.verticalCenter
32+
}
33+
34+
Repeater {
35+
id:rep
36+
Layout.alignment: Qt.AlignHCenter
37+
width: parent.width
38+
model: lableList
39+
40+
delegate: RadioButton {
41+
id: labelIndicator
42+
padding: 0
43+
checked: index === 0
44+
indicator: Item{ }
45+
46+
contentItem: Rectangle{
47+
implicitHeight: control.implicitHeight - 1
48+
implicitWidth: tags.implicitWidth + 106
49+
radius: control.radius
50+
color: labelIndicator.checked ? setColors : "transparent"
51+
52+
HoverHandler{
53+
id: tagHovered
54+
}
55+
56+
Label {
57+
id:tags
58+
text: modelData
59+
font.pixelSize: 20
60+
font.family: "Montserrat"
61+
color: Theme.fontColor
62+
anchors.centerIn: parent
63+
}
64+
}
65+
}
66+
}
67+
}
68+
}

Component/SearchBox.qml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
import QtQuick.Layouts 1.3
4+
5+
import Theme 1.0
6+
7+
TextField {
8+
id: control
9+
property bool isBold: true
10+
property real radius: 12.0
11+
property string setIcon: ""
12+
property alias icon: icon
13+
opacity: 0.8
14+
focus: true
15+
implicitWidth: 340
16+
implicitHeight: 70
17+
placeholderText: qsTr("Navigation")
18+
placeholderTextColor: Qt.lighter(Theme.fontColor)
19+
selectedTextColor: "#1ca254"
20+
selectionColor: "#305e4b"
21+
font.pixelSize: 24
22+
font.family: "Montserrat"
23+
font.bold: isBold ? Font.DemiBold : Font.Normal
24+
font.weight: isBold ? Font.DemiBold : Font.Normal
25+
color: Theme.fontColor
26+
verticalAlignment: Qt.AlignVCenter
27+
28+
Image{
29+
id:icon
30+
source: setIcon
31+
anchors.left: parent.left
32+
anchors.leftMargin: 5
33+
anchors.verticalCenter: parent.verticalCenter
34+
}
35+
36+
background: Rectangle{
37+
implicitHeight: control.implicitHeight
38+
implicitWidth: control.implicitWidth
39+
anchors.verticalCenter: parent.verticalCenter
40+
color: Theme.background
41+
radius: control.radius
42+
}
43+
}

Component/SettingsDialog.qml

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
import QtQuick 2.15
2+
import QtQuick.Window 2.15
3+
import QtQuick.Controls 2.15
4+
5+
import QtQuick.Layouts 1.3
6+
import GeneralMagic 2.0
7+
import Theme 1.0
8+
import "./"
9+
import "./SettingsPages"
10+
ApplicationWindow {
11+
id:root
12+
width: 1300
13+
height: 750
14+
minimumHeight: 750
15+
maximumHeight: 750
16+
minimumWidth: 1300
17+
maximumWidth: 1300
18+
flags: Qt.Dialog
19+
signal applyTheme(var mapInfo)
20+
21+
Shortcut {
22+
sequence: "Ctrl+Q"
23+
onActivated: Qt.quit()
24+
}
25+
26+
Connections{
27+
target: mainStack.currentItem
28+
function onApplyTheme(mapInfo){
29+
root.applyTheme(mapInfo)
30+
}
31+
}
32+
33+
Component{
34+
id:quickControl
35+
QuickControl{
36+
37+
}
38+
}
39+
40+
Component{
41+
id:autopilote
42+
Autopilote{
43+
44+
}
45+
}
46+
47+
Component{
48+
id:display
49+
Display{
50+
51+
}
52+
}
53+
54+
Component{
55+
id:driving
56+
Driving{
57+
58+
}
59+
}
60+
61+
Component{
62+
id:light
63+
Lights{
64+
65+
}
66+
}
67+
68+
Component{
69+
id:lock
70+
Lock{
71+
72+
}
73+
}
74+
75+
Component{
76+
id:safety
77+
SafetyAndSecurity{
78+
79+
}
80+
}
81+
82+
Component{
83+
id:service
84+
Service{
85+
86+
}
87+
}
88+
89+
Component{
90+
id:mapSettings
91+
MapThemes{
92+
93+
}
94+
}
95+
96+
97+
function switchPage(index){
98+
switch(index){
99+
case 0:
100+
mainStack.replace(null,quickControl)
101+
break;
102+
case 1:
103+
mainStack.replace(null,light)
104+
break;
105+
case 2:
106+
mainStack.replace(null,lock)
107+
break;
108+
case 3:
109+
mainStack.replace(null,display)
110+
break;
111+
case 4:
112+
mainStack.replace(null,driving)
113+
break;
114+
case 5:
115+
mainStack.replace(null,autopilote)
116+
break;
117+
case 6:
118+
mainStack.replace(null,safety)
119+
break;
120+
case 7:
121+
mainStack.replace(null,service)
122+
break;
123+
case 8:
124+
mainStack.replace(null,mapSettings)
125+
break;
126+
}
127+
}
128+
129+
SplitView {
130+
id: splitView
131+
anchors.fill: parent
132+
orientation: Qt.Horizontal
133+
134+
handle: Item {
135+
visible: false
136+
}
137+
138+
Rectangle {
139+
id: mainRect
140+
color: Theme.isDarkMode ? "#161616" : "#FFFFFF"
141+
SplitView.preferredWidth: 400
142+
SplitView.maximumWidth: 400
143+
SplitView.minimumWidth: 400
144+
145+
ListView{
146+
id:listItemView
147+
anchors.fill: parent
148+
anchors.margins: 10
149+
focus: true
150+
spacing: 25 // Add spacing here between items
151+
highlightFollowsCurrentItem :true
152+
onCurrentIndexChanged: {
153+
root.switchPage(currentIndex)
154+
}
155+
156+
highlight: Item{
157+
visible: false
158+
}
159+
160+
model: SideListModel{}
161+
delegate: SideListDelegate{
162+
width: listItemView.width
163+
lightIconRectIcon:iconName
164+
darkIconRectIcon:iconName.replace(Qt.resolvedUrl("qrc:/Icons/Settings/"), Qt.resolvedUrl("qrc:/Icons/Settings/light/"));
165+
iconRectColor: iconColor
166+
spacing: 50
167+
onClicked:{
168+
ListView.view.currentIndex = index
169+
root.switchPage(index)
170+
}
171+
}
172+
}
173+
}
174+
175+
Rectangle {
176+
id: collapsibleRect
177+
SplitView.fillWidth: true
178+
color: Theme.isDarkMode ? "#0E0E0E" : "#F0F0F0"
179+
clip: true
180+
Loader{
181+
id:mainLoader
182+
anchors.fill: parent
183+
StackView{
184+
id:mainStack
185+
anchors.fill: parent
186+
initialItem:QuickControl{}
187+
}
188+
}
189+
}
190+
}
191+
}

0 commit comments

Comments
 (0)