@@ -21,7 +21,7 @@ ColumnLayout {
21
21
header: qsTr (" Light" )
22
22
actionItem: Button {
23
23
anchors .centerIn : parent
24
- visible: ! Theme .dark
24
+ visible: ! Theme .manualDark && Theme . manualTheme
25
25
icon .source : " image://images/check"
26
26
icon .color : Theme .color .neutral9
27
27
icon .height : 24
@@ -33,7 +33,8 @@ ColumnLayout {
33
33
}
34
34
}
35
35
onClicked: {
36
- Theme .dark = false
36
+ Theme .manualTheme = true ;
37
+ Theme .manualDark = false ;
37
38
}
38
39
}
39
40
Separator { Layout .fillWidth : true }
@@ -42,7 +43,7 @@ ColumnLayout {
42
43
header: qsTr (" Dark" )
43
44
actionItem: Button {
44
45
anchors .centerIn : parent
45
- visible: Theme .dark
46
+ visible: Theme .manualDark && Theme . manualTheme
46
47
icon .source : " image://images/check"
47
48
icon .color : Theme .color .neutral9
48
49
icon .height : 24
@@ -54,7 +55,38 @@ ColumnLayout {
54
55
}
55
56
}
56
57
onClicked: {
57
- Theme .dark = true ;
58
+ Theme .manualTheme = true ;
59
+ Theme .manualDark = true ;
60
+ }
61
+ }
62
+ Separator { Layout .fillWidth : true }
63
+ Setting {
64
+ id: systemThemeSetting
65
+ property bool systemThemeAvailable: Theme .systemThemeAvailable
66
+ Layout .fillWidth : true
67
+ header: qsTr (" System" )
68
+ actionItem: Button {
69
+ anchors .centerIn : parent
70
+ visible: ! Theme .manualTheme
71
+ icon .source : " image://images/check"
72
+ icon .color : Theme .color .neutral9
73
+ icon .height : 24
74
+ icon .width : 24
75
+ background: null
76
+
77
+ Behavior on icon .color {
78
+ ColorAnimation { duration: 150 }
79
+ }
80
+ }
81
+ Component .onCompleted : {
82
+ if (systemThemeAvailable) {
83
+ systemThemeSetting .state = " FILLED"
84
+ } else {
85
+ systemThemeSetting .state = " DISABLED"
86
+ }
87
+ }
88
+ onClicked: {
89
+ Theme .manualTheme = false
58
90
}
59
91
}
60
92
}
0 commit comments