diff options
| author | ATMDA <atdma2600@gmail.com> | 2025-11-09 22:52:21 -0500 |
|---|---|---|
| committer | ATMDA <atdma2600@gmail.com> | 2025-11-09 22:52:21 -0500 |
| commit | d20a5095bb38d843c7f6327a553b9929e229a3b5 (patch) | |
| tree | c186eb5ec54f67a40a6c2b9fb1f7206637f67cd1 | |
| parent | controlcenter: appearance pane (diff) | |
| download | caelestia-shell-d20a5095bb38d843c7f6327a553b9929e229a3b5.tar.gz caelestia-shell-d20a5095bb38d843c7f6327a553b9929e229a3b5.tar.bz2 caelestia-shell-d20a5095bb38d843c7f6327a553b9929e229a3b5.zip | |
fix: color schemes and variants in appearance pane
| -rw-r--r-- | modules/controlcenter/appearance/AppearancePane.qml | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/modules/controlcenter/appearance/AppearancePane.qml b/modules/controlcenter/appearance/AppearancePane.qml index ab00345..b2692c8 100644 --- a/modules/controlcenter/appearance/AppearancePane.qml +++ b/modules/controlcenter/appearance/AppearancePane.qml @@ -130,7 +130,25 @@ RowLayout { StateLayer { function onClicked(): void { - Quickshell.execDetached(["caelestia", "scheme", "set", "-v", modelData.variant]); + const variant = modelData.variant; + + // Optimistic update - set immediately + Schemes.currentVariant = variant; + + // Execute the command + Quickshell.execDetached(["caelestia", "scheme", "set", "-v", variant]); + + // Reload after a delay to confirm + Qt.callLater(() => { + reloadTimer.restart(); + }); + } + } + + Timer { + id: reloadTimer + interval: 300 + onTriggered: { Schemes.reload(); } } @@ -209,7 +227,27 @@ RowLayout { StateLayer { function onClicked(): void { - Quickshell.execDetached(["caelestia", "scheme", "set", "-n", modelData.name, "-f", modelData.flavour]); + const name = modelData.name; + const flavour = modelData.flavour; + const schemeKey = `${name} ${flavour}`; + + // Optimistic update - set immediately + Schemes.currentScheme = schemeKey; + + // Execute the command + Quickshell.execDetached(["caelestia", "scheme", "set", "-n", name, "-f", flavour]); + + // Reload after a delay to confirm + Qt.callLater(() => { + reloadTimer.restart(); + }); + } + } + + Timer { + id: reloadTimer + interval: 300 + onTriggered: { Schemes.reload(); } } |