Skip to content

Commit 8a8c437

Browse files
committed
Some Code Refactor
1 parent f592706 commit 8a8c437

File tree

7 files changed

+38
-23
lines changed

7 files changed

+38
-23
lines changed

GameScreens/HomeScreen.qml

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import "../ScreensComponents"
66
import "../Settings"
77
ScreenPage{
88
anchors.fill: parent
9-
property int buttonWidth:root.width *0.20
10-
property int buttonHeight:root.height *0.25
119
SplitView {
1210
id: splitView
1311
anchors.fill: parent

GameScreens/ScreenPage.qml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import QtQuick 2.15
2+
import QtQuick.Controls 2.5
23
Item {
34
anchors.fill: parent
4-
Rectangle{
5-
anchors.fill: parent
6-
color:backgroundColor
7-
}
5+
property var stack: StackView.view
6+
StackView.visible: true
87
}

Settings/GeneralSettingsPage.qml

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ ScreenPage{
88
anchors.fill: parent
99
ColumnLayout{
1010
Layout.fillWidth: true
11+
spacing: 50
1112
PrefsComboBox{
12-
anchors.centerIn: parent
13+
model: SideListModel{}//["Adesh","Kabir","Raj","Adesh","Kabir","Raj","Adesh","Kabir","Raj"]
14+
}
15+
PrefsComboBoxLabel{
1316
model: SideListModel{}//["Adesh","Kabir","Raj","Adesh","Kabir","Raj","Adesh","Kabir","Raj"]
1417
}
1518
}

Settings/Settings.qml

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import QtQuick 2.15
22
import QtQuick.Controls 2.15
33
import QtQuick.Layouts 1.3
4-
4+
import "../GameScreens"
55
ApplicationWindow {
66
id:root
77
visible: true
@@ -82,11 +82,16 @@ ApplicationWindow {
8282
SplitView.fillWidth: true
8383
color: "#fafbfb"
8484
clip: true
85-
Text {
86-
anchors.centerIn: parent
87-
font.pixelSize: 24
88-
text: "NOT COLLAPSED"
89-
Behavior on rotation { NumberAnimation { duration: 100 } }
85+
Loader{
86+
id:mainLoader
87+
anchors.fill: parent
88+
StackView{
89+
id:mainStack
90+
anchors.fill: parent
91+
initialItem: GeneralSettingsPage{
92+
anchors.fill: parent
93+
}
94+
}
9095
}
9196
}
9297
}

common/PrefsComboBox.qml

+10-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ ComboBox {
1010
property string iconRectColor: iconColor ? iconColor : ""
1111
property string iconRectIcon: iconName ? iconName : ""
1212

13-
width: root.width * 1.4
13+
width: root.width * 1.2
1414
height: 40
1515
hoverEnabled: true
1616
focus: true
1717

1818
background: Rectangle{
19-
color: itemDelegate.hovered ? "blue" : "transparent"
19+
color: itemDelegate.hovered ? "#0437F2" : "transparent"
2020
anchors.fill: parent
2121
radius: 8
2222
}
@@ -145,12 +145,14 @@ ComboBox {
145145
implicitWidth: 200
146146
implicitHeight: 41
147147
color: root.down ? Qt.darker(root.checkedColor, 1.2) : root.checkedColor
148-
radius: 4
148+
radius: 6
149+
border.width: 0.6
150+
border.color: "grey"
149151
}
150152

151153
popup: Popup {
152154
y: root.height - 1
153-
width: root.width * 1.5
155+
width: root.width * 1.3
154156
implicitHeight: contentItem.implicitHeight > 250 ? 250 : contentItem.implicitHeight
155157
padding: 4
156158
contentItem: ListView {
@@ -165,8 +167,10 @@ ComboBox {
165167

166168
background: Rectangle {
167169
anchors.fill: parent
168-
color: "#dde4de"
169-
radius: 4
170+
color: "white"
171+
radius: 6
172+
border.width: 0.6
173+
border.color: "grey"
170174
clip: true
171175
}
172176
}

common/PrefsComboBoxLabel.qml

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ComboBox {
1515
focus: true
1616

1717
background: Rectangle{
18-
color: itemDelegate.hovered ? "blue" : "transparent"
18+
color: itemDelegate.hovered ? "#0437F2" : "transparent"
1919
anchors.fill: parent
2020
radius: 8
2121
}
@@ -110,7 +110,9 @@ ComboBox {
110110
implicitWidth: 200
111111
implicitHeight: 41
112112
color: root.down ? Qt.darker(root.checkedColor, 1.2) : root.checkedColor
113-
radius: 4
113+
radius: 6
114+
border.width: 0.6
115+
border.color: "grey"
114116
}
115117

116118
popup: Popup {
@@ -130,8 +132,9 @@ ComboBox {
130132

131133
background: Rectangle {
132134
anchors.fill: parent
133-
color: "#dde4de"
134-
radius: 4
135+
radius: 6
136+
border.width: 0.6
137+
border.color: "grey"
135138
clip: true
136139
}
137140
}

qml.qrc

+3
Original file line numberDiff line numberDiff line change
@@ -593,5 +593,8 @@
593593
<file>Settings/Settings.qml</file>
594594
<file>Settings/SideListDelegate.qml</file>
595595
<file>Settings/SideListModel.qml</file>
596+
<file>Settings/GeneralSettingsPage.qml</file>
597+
<file>common/PrefsComboBox.qml</file>
598+
<file>common/PrefsComboBoxLabel.qml</file>
596599
</qresource>
597600
</RCC>

0 commit comments

Comments
 (0)