Skip to content

Commit 57ad2a8

Browse files
committed
system color introduce
1 parent 2405ea4 commit 57ad2a8

22 files changed

+197
-60
lines changed

AddItemScreen/AddItemDialog.qml

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import QtQuick 2.15
22
import QtQuick.Controls 2.15
33
import QtQuick.Layouts 1.3
4+
45
import "../GameScreens"
6+
import "../common"
7+
import AppStyle 1.0
8+
import FontStyle 1.0
9+
import ".././"
510
ApplicationWindow {
611
id:root
712
visible: true
@@ -11,7 +16,18 @@ ApplicationWindow {
1116
maximumWidth: 850
1217
minimumHeight: 650
1318
maximumHeight: 650
14-
title: "Settings"
15-
color: "lightgrey"
16-
flags: Qt.Window
19+
title: "Add Items"
20+
color: AppStyle.background
21+
flags: Qt.Dialog
22+
Loader{
23+
id:mainLoader
24+
anchors.fill: parent
25+
StackView{
26+
id:mainStack
27+
anchors.fill: parent
28+
initialItem: AddItemHomePage{
29+
anchors.fill: parent
30+
}
31+
}
32+
}
1733
}

AddItemScreen/AddItemHomePage.qml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.5
3+
import QtQuick.Layouts 1.3
4+
5+
import "../GameScreens"
6+
import "../"
7+
import AppStyle 1.0
8+
import FontStyle 1.0
9+
10+
ScreenPage {
11+
id:root
12+
contentHeight: mainLayout.implicitHeight
13+
property bool isBold: false
14+
Page {
15+
anchors.fill: parent
16+
clip: true
17+
background: Rectangle{
18+
anchors.fill: parent
19+
color: AppStyle.transparent
20+
}
21+
header: Rectangle{
22+
23+
}
24+
25+
ColumnLayout{
26+
id: mainLayout
27+
anchors.left: parent.left
28+
anchors.right: parent.right
29+
spacing: 20
30+
}
31+
}
32+
}

AppStyle.qml

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pragma Singleton
22
import QtQuick 2.9
33
import QtQuick.Controls 2.5
4-
4+
import QtQuick.Controls.Material 2.3
55
QtObject {
66
id: styleObject
77

@@ -41,14 +41,33 @@ QtObject {
4141
readonly property color sliderColor: "#6ccaf2"
4242
readonly property color errorColor: "#ba3f62"
4343
readonly property color infoColor: "#3fba62"
44-
readonly property color sideBarDarkColor: AppTheme.darkTheme ? "#313131" : "#dde4de"
44+
45+
46+
//Device Color
47+
readonly property color systemColor: Material.accent
48+
readonly property color systemColorLighter: Qt.lighter(Material.accent)
49+
readonly property color systemColorDarker: Qt.lighter(Material.accent)
50+
51+
//App Color
52+
readonly property color appColor: "#0570eb"
53+
readonly property color appColorLighter: Qt.lighter("#0570eb")
54+
readonly property color appColorDarker: Qt.lighter("#0570eb")
55+
56+
// Single ApplicationColor:
57+
readonly property color applicationColor: AppTheme.systemColor ? systemColor : appColor
58+
readonly property color applicationColorLighter: AppTheme.systemColor ? systemColorLighter : appColorLighter
59+
readonly property color applicationColorDarker: AppTheme.systemColor ? systemColorDarker : appColorDarker
60+
61+
readonly property color sideBarDarkColor: AppTheme.darkTheme ? "#313131" : "#f7f7f7"
4562
readonly property color titleBarColor: AppTheme.darkTheme ? "#313131" : "transparent"
63+
readonly property color background: AppTheme.darkTheme ? "#262626" : "#FFFFFF";
64+
65+
4666

4767
// light theme colors
4868

4969
readonly property color accent: "#FFFFFF";
5070
readonly property color pageground: "#FFFFFF";
51-
readonly property color background: AppTheme.darkTheme ? "#262626" : "#FFFFFF";
5271
readonly property color backgroundActivated: "#FFFFFF";
5372
readonly property color backgroundDeactivated: "#E5E5E5";
5473
readonly property color backgroundHovered: "#dcdcdc";

GameScreens/HomeScreen.qml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import QtQuick 2.15
22
import QtQuick.Layouts 1.3
33
import QtQuick.Controls 2.15
4+
import QtQuick.Controls.Material 2.3
45
import "./"
56
import "../ScreensComponents"
67
import "../Settings"
@@ -24,7 +25,7 @@ ScreenPage{
2425
hoverEnabled: true
2526
onHoveredChanged: {
2627
if(containsMouse){
27-
colorLayer.color = "blue"
28+
colorLayer.color = AppStyle.applicationColor
2829
}else{
2930
colorLayer.color = mainRect.color
3031
}
@@ -39,7 +40,7 @@ ScreenPage{
3940

4041
Rectangle {
4142
id: mainRect
42-
color: AppStyle.sideBarDarkColor
43+
color: "#203040"
4344
SplitView.preferredWidth: 300
4445
SplitView.maximumWidth: 300
4546
SplitView.minimumWidth: 300
@@ -56,14 +57,13 @@ ScreenPage{
5657
Layout.alignment: Qt.AlignVCenter
5758
Layout.leftMargin: 10
5859
radius: 8
59-
color:"blue"
60-
opacity: 0.7
60+
color: AppStyle.applicationColor
6161
focus: true
6262

6363
Rectangle{
6464
height: parent.height * 0.59
6565
width: 5
66-
color:"yellow"
66+
color: "yellow"
6767
anchors.rightMargin: 5
6868
anchors.verticalCenter: parent.verticalCenter
6969
Layout.alignment: Qt.AlignRight
@@ -74,6 +74,7 @@ ScreenPage{
7474

7575
model: SideListModel{}
7676
delegate: SideListDelegate{
77+
textColorWhite: true
7778
width: listItemView.width
7879
iconRectIcon: iconName
7980
iconRectColor: iconColor

Settings/AboutPage.qml

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ScreenPage{
1717
clip: true
1818
background: Rectangle{
1919
anchors.fill: parent
20-
color: "transparent"
20+
color: AppStyle.transparent
2121
}
2222

2323
ColumnLayout{
@@ -100,11 +100,11 @@ ScreenPage{
100100
width: innerText.width + 40
101101
height: 38
102102
buttonText: "Check For Updated";
103-
innerText.color: "#0570eb"
104-
color: "transparent"
105-
hoverColor: "transparent"
106-
pressColor: "transparent"
107-
borderColor: "#0570eb"
103+
innerText.color:AppStyle.applicationColor
104+
color: AppStyle.transparent
105+
hoverColor: AppStyle.transparent
106+
pressColor: AppStyle.transparent
107+
borderColor: AppStyle.applicationColor
108108
fontSize: 12
109109
borderWidth: 1
110110
borderRadius: 8

Settings/AdvancedSettingsPage.qml

+10-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import QtQuick.Controls 2.15
44
import "../GameScreens"
55
import "../common"
66
import "../Settings"
7+
8+
import "../"
9+
import AppStyle 1.0
10+
import FontStyle 1.0
711
ScreenPage{
812
id:root
913
contentHeight: mainLayout.implicitHeight
@@ -12,7 +16,7 @@ ScreenPage{
1216
clip: true
1317
background: Rectangle{
1418
anchors.fill: parent
15-
color: "transparent"
19+
color: AppStyle.transparent
1620
}
1721

1822
ColumnLayout{
@@ -68,11 +72,11 @@ ScreenPage{
6872
width: innerText.width + 40
6973
height: 38
7074
buttonText: "Send Diagnostics";
71-
innerText.color: "#0570eb"
72-
color: "transparent"
73-
hoverColor: "transparent"
74-
pressColor: "transparent"
75-
borderColor:"#0570eb"
75+
innerText.color: AppStyle.applicationColor
76+
color: AppStyle.transparent
77+
hoverColor: AppStyle.transparent
78+
pressColor: AppStyle.transparent
79+
borderColor: AppStyle.applicationColor
7680
fontSize: 12
7781
borderWidth: 1
7882
borderRadius: 8

Settings/AppearanceSettingsPage.qml

+38-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,27 @@ import QtQuick.Controls 2.15
44
import "../GameScreens"
55
import "../common"
66
import "../Settings"
7+
8+
import "../"
9+
import AppStyle 1.0
10+
import FontStyle 1.0
711
ScreenPage{
812
id:root
913
contentHeight: mainLayout.implicitHeight
14+
15+
ListModel{
16+
id:themeModel
17+
ListElement {
18+
name: "System"
19+
}
20+
ListElement {
21+
name: "Light"
22+
}
23+
ListElement {
24+
name: "Dark"
25+
}
26+
}
27+
1028
Pane {
1129
anchors.fill: parent
1230
clip: true
@@ -23,11 +41,27 @@ ScreenPage{
2341

2442
LablePrefsComboBox{
2543
label:qsTr("Theme :")
26-
model: SideListModel{}
44+
model: themeModel
45+
currentIndex: 0
46+
onCurrentIndexChanged: {
47+
if(currentIndex === 0){
48+
//System Theme
49+
}else if(currentIndex === 1){
50+
AppTheme.swapThemePalette()
51+
// Light Theme
52+
}else{
53+
AppTheme.swapThemePalette()
54+
//Dark Theme
55+
}
56+
}
2757
}
2858

2959
PrefsCheckbox{
3060
text:qsTr("Use device accent color")
61+
checked: AppTheme.systemColor
62+
onCheckedChanged: {
63+
AppTheme.systemColor = checked
64+
}
3165
}
3266

3367
PrefsSettingsHeader{
@@ -41,17 +75,17 @@ ScreenPage{
4175
id:left
4276
spacing: 6
4377
onClicked: {
44-
left.borderColor = "#0570eb"
78+
left.borderColor = AppStyle.applicationColor
4579
right.borderColor = "grey"
4680
}
4781
}
4882
PrefsDensity{
4983
id:right
50-
borderColor: "#0570eb"
84+
borderColor: AppStyle.applicationColor
5185
spacing: 2
5286
onClicked: {
5387
left.borderColor = "grey"
54-
right.borderColor = "#0570eb"
88+
right.borderColor = AppStyle.applicationColor
5589
}
5690
}
5791
}

Settings/BrowserSettingsPage.qml

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import QtQuick.Controls 2.15
44
import "../GameScreens"
55
import "../common"
66
import "../Settings"
7+
8+
import "../"
9+
import AppStyle 1.0
10+
import FontStyle 1.0
711
ScreenPage{
812
id:root
913
contentHeight: mainLayout.implicitHeight
@@ -32,10 +36,10 @@ ScreenPage{
3236
height: 38
3337
buttonText: "Get 1Password for Your Browser";
3438
innerText.color: "white"
35-
color: "#0570eb"
36-
hoverColor: "#0570eb"
37-
pressColor: "#0570eb"
38-
borderColor: "#0570eb"
39+
color: AppStyle.applicationColor
40+
hoverColor: AppStyle.applicationColor
41+
pressColor: AppStyle.applicationColor
42+
borderColor: AppStyle.applicationColor
3943
fontSize: 12
4044
borderWidth: 1
4145
borderRadius: 8

Settings/DeveloperSettingsPage.qml

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import QtQuick.Controls 2.15
44
import "../GameScreens"
55
import "../common"
66
import "../Settings"
7+
8+
import "../"
9+
import AppStyle 1.0
10+
import FontStyle 1.0
711
ScreenPage{
812
id:root
913
contentHeight: mainLayout.implicitHeight
@@ -12,7 +16,7 @@ ScreenPage{
1216
clip: true
1317
background: Rectangle{
1418
anchors.fill: parent
15-
color: "transparent"
19+
color: AppStyle.transparent
1620
}
1721

1822
ColumnLayout{
@@ -36,10 +40,10 @@ ScreenPage{
3640
height: 38
3741
buttonText: "Set Up SSH Agent ...";
3842
innerText.color: "white"
39-
color: "#0570eb"
40-
hoverColor: "#0570eb"
41-
pressColor: "#0570eb"
42-
borderColor:"#0570eb"
43+
color: AppStyle.applicationColor
44+
hoverColor: AppStyle.applicationColor
45+
pressColor: AppStyle.applicationColor
46+
borderColor: AppStyle.applicationColor
4347
fontSize: 12
4448
borderWidth: 1
4549
borderRadius: 8

Settings/Settings.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ApplicationWindow {
9898
hoverEnabled: true
9999
onHoveredChanged: {
100100
if(containsMouse){
101-
colorLayer.color = "blue"
101+
colorLayer.color = AppStyle.applicationColor
102102
}else{
103103
colorLayer.color = mainRect.color
104104
}
@@ -135,7 +135,7 @@ ApplicationWindow {
135135
Layout.alignment: Qt.AlignVCenter
136136
Layout.leftMargin: 10
137137
radius: 8
138-
color:"#0570eb"
138+
color: AppStyle.applicationColor
139139
focus: true
140140

141141
Rectangle{

0 commit comments

Comments
 (0)