diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-17 22:44:29 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-17 22:44:29 +1000 |
| commit | e373fe0375a45aa2825e28c7326bed1a3cd97c65 (patch) | |
| tree | c410f04b6b7616a0f954850ff234e8fcc4b41a15 | |
| parent | popouts: fix activewindow screencopy (diff) | |
| download | caelestia-shell-e373fe0375a45aa2825e28c7326bed1a3cd97c65.tar.gz caelestia-shell-e373fe0375a45aa2825e28c7326bed1a3cd97c65.tar.bz2 caelestia-shell-e373fe0375a45aa2825e28c7326bed1a3cd97c65.zip | |
launcher: fix wallpaper preview colours
Also disable transparency action (not impled and won't be in the near future)
| -rw-r--r-- | modules/launcher/Actions.qml | 1 | ||||
| -rw-r--r-- | modules/launcher/Content.qml | 2 | ||||
| -rw-r--r-- | services/Colours.qml | 6 | ||||
| -rw-r--r-- | services/Wallpapers.qml | 20 |
4 files changed, 11 insertions, 18 deletions
diff --git a/modules/launcher/Actions.qml b/modules/launcher/Actions.qml index 9f6f52c..8df687b 100644 --- a/modules/launcher/Actions.qml +++ b/modules/launcher/Actions.qml @@ -42,6 +42,7 @@ Singleton { name: qsTr("Transparency") desc: qsTr("Change shell transparency") icon: "opacity" + disabled: true function onClicked(list: AppList): void { root.autocomplete(list, "transparency"); diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index b6d1056..9e08a93 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -81,6 +81,8 @@ Item { const currentItem = list.currentList?.currentItem; if (currentItem) { if (list.showWallpapers) { + if (currentItem.modelData.path !== Wallpapers.actualCurrent) + Wallpapers.previewColourLock = true; Wallpapers.setWallpaper(currentItem.modelData.path); root.visibilities.launcher = false; } else if (text.startsWith(Config.launcher.actionPrefix)) { diff --git a/services/Colours.qml b/services/Colours.qml index 20fb6aa..53ca90e 100644 --- a/services/Colours.qml +++ b/services/Colours.qml @@ -12,7 +12,6 @@ Singleton { readonly property list<string> colourNames: ["rosewater", "flamingo", "pink", "mauve", "red", "maroon", "peach", "yellow", "green", "teal", "sky", "sapphire", "blue", "lavender"] property bool showPreview - property bool endPreviewOnNextChange property bool light readonly property Colours palette: showPreview ? preview : current readonly property Colours current: Colours {} @@ -45,11 +44,6 @@ Singleton { if (colours.hasOwnProperty(propName)) colours[propName] = `#${colour}`; } - - if (!isPreview || (isPreview && endPreviewOnNextChange)) { - showPreview = false; - endPreviewOnNextChange = false; - } } function setMode(mode: string): void { diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml index a667017..fc965e5 100644 --- a/services/Wallpapers.qml +++ b/services/Wallpapers.qml @@ -18,6 +18,7 @@ Singleton { readonly property string current: showPreview ? previewPath : actualCurrent property string previewPath property string actualCurrent + property bool previewColourLock readonly property list<var> preppedWalls: list.map(w => ({ name: Fuzzy.prepare(w.name), @@ -35,8 +36,7 @@ Singleton { function setWallpaper(path: string): void { actualCurrent = path; - setWall.path = path; - setWall.startDetached(); + Quickshell.execDetached(["caelestia", "wallpaper", "-f", path]); } function preview(path: string): void { @@ -47,7 +47,8 @@ Singleton { function stopPreview(): void { showPreview = false; - Colours.endPreviewOnNextChange = true; + if (!previewColourLock) + Colours.showPreview = false; } reloadableId: "wallpapers" @@ -72,7 +73,10 @@ Singleton { path: root.currentNamePath watchChanges: true onFileChanged: reload() - onLoaded: root.actualCurrent = text().trim() + onLoaded: { + root.actualCurrent = text().trim(); + root.previewColourLock = false; + } } Process { @@ -88,14 +92,6 @@ Singleton { } Process { - id: setWall - - property string path - - command: ["caelestia", "wallpaper", "-f", path] - } - - Process { running: true command: ["find", root.path, "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"] stdout: StdioCollector { |