mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 14:05:38 -05:00
ipc for light/dark mode
This commit is contained in:
@@ -218,6 +218,9 @@ Singleton {
|
||||
|
||||
function setLightMode(lightMode) {
|
||||
isLightMode = lightMode;
|
||||
if (typeof Theme !== "undefined") {
|
||||
Theme.isLightMode = lightMode;
|
||||
}
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
@@ -740,4 +743,27 @@ Singleton {
|
||||
return "SUCCESS: Wallpaper cleared"
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "theme"
|
||||
|
||||
function toggle(): string {
|
||||
root.setLightMode(!root.isLightMode)
|
||||
return root.isLightMode ? "light" : "dark"
|
||||
}
|
||||
|
||||
function light(): string {
|
||||
root.setLightMode(true)
|
||||
return "light"
|
||||
}
|
||||
|
||||
function dark(): string {
|
||||
root.setLightMode(false)
|
||||
return "dark"
|
||||
}
|
||||
|
||||
function get(): string {
|
||||
return root.isLightMode ? "light" : "dark"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user