add theme switcher
This commit is contained in:
parent
143889683b
commit
d69ec48728
9 changed files with 126 additions and 68 deletions
29
modules/Services/State.qml
Normal file
29
modules/Services/State.qml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
property alias s: stateAdapter
|
||||
property alias v: state
|
||||
FileView {
|
||||
id: state
|
||||
path: Qt.resolvedUrl(Quickshell.shellDir + "/settings/state.json")
|
||||
watchChanges: true
|
||||
onLoadFailed: {
|
||||
writeAdapter()
|
||||
}
|
||||
onAdapterUpdated: writeAdapter()
|
||||
onFileChanged: reload()
|
||||
adapter: JsonAdapter {
|
||||
id: stateAdapter
|
||||
property bool themeSwitcherVisible: false
|
||||
}
|
||||
|
||||
}
|
||||
Component.onCompleted: console.log("say gex")
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue