launcher: fix wallpaper preview colours

Also disable transparency action (not impled and won't be in the near future)
This commit is contained in:
2 * r + 2 * t 2025-06-17 22:44:29 +10:00
parent ee0f243ca3
commit e373fe0375
4 changed files with 11 additions and 18 deletions

View file

@ -42,6 +42,7 @@ Singleton {
name: qsTr("Transparency") name: qsTr("Transparency")
desc: qsTr("Change shell transparency") desc: qsTr("Change shell transparency")
icon: "opacity" icon: "opacity"
disabled: true
function onClicked(list: AppList): void { function onClicked(list: AppList): void {
root.autocomplete(list, "transparency"); root.autocomplete(list, "transparency");

View file

@ -81,6 +81,8 @@ Item {
const currentItem = list.currentList?.currentItem; const currentItem = list.currentList?.currentItem;
if (currentItem) { if (currentItem) {
if (list.showWallpapers) { if (list.showWallpapers) {
if (currentItem.modelData.path !== Wallpapers.actualCurrent)
Wallpapers.previewColourLock = true;
Wallpapers.setWallpaper(currentItem.modelData.path); Wallpapers.setWallpaper(currentItem.modelData.path);
root.visibilities.launcher = false; root.visibilities.launcher = false;
} else if (text.startsWith(Config.launcher.actionPrefix)) { } else if (text.startsWith(Config.launcher.actionPrefix)) {

View file

@ -12,7 +12,6 @@ Singleton {
readonly property list<string> colourNames: ["rosewater", "flamingo", "pink", "mauve", "red", "maroon", "peach", "yellow", "green", "teal", "sky", "sapphire", "blue", "lavender"] readonly property list<string> colourNames: ["rosewater", "flamingo", "pink", "mauve", "red", "maroon", "peach", "yellow", "green", "teal", "sky", "sapphire", "blue", "lavender"]
property bool showPreview property bool showPreview
property bool endPreviewOnNextChange
property bool light property bool light
readonly property Colours palette: showPreview ? preview : current readonly property Colours palette: showPreview ? preview : current
readonly property Colours current: Colours {} readonly property Colours current: Colours {}
@ -45,11 +44,6 @@ Singleton {
if (colours.hasOwnProperty(propName)) if (colours.hasOwnProperty(propName))
colours[propName] = `#${colour}`; colours[propName] = `#${colour}`;
} }
if (!isPreview || (isPreview && endPreviewOnNextChange)) {
showPreview = false;
endPreviewOnNextChange = false;
}
} }
function setMode(mode: string): void { function setMode(mode: string): void {

View file

@ -18,6 +18,7 @@ Singleton {
readonly property string current: showPreview ? previewPath : actualCurrent readonly property string current: showPreview ? previewPath : actualCurrent
property string previewPath property string previewPath
property string actualCurrent property string actualCurrent
property bool previewColourLock
readonly property list<var> preppedWalls: list.map(w => ({ readonly property list<var> preppedWalls: list.map(w => ({
name: Fuzzy.prepare(w.name), name: Fuzzy.prepare(w.name),
@ -35,8 +36,7 @@ Singleton {
function setWallpaper(path: string): void { function setWallpaper(path: string): void {
actualCurrent = path; actualCurrent = path;
setWall.path = path; Quickshell.execDetached(["caelestia", "wallpaper", "-f", path]);
setWall.startDetached();
} }
function preview(path: string): void { function preview(path: string): void {
@ -47,7 +47,8 @@ Singleton {
function stopPreview(): void { function stopPreview(): void {
showPreview = false; showPreview = false;
Colours.endPreviewOnNextChange = true; if (!previewColourLock)
Colours.showPreview = false;
} }
reloadableId: "wallpapers" reloadableId: "wallpapers"
@ -72,7 +73,10 @@ Singleton {
path: root.currentNamePath path: root.currentNamePath
watchChanges: true watchChanges: true
onFileChanged: reload() onFileChanged: reload()
onLoaded: root.actualCurrent = text().trim() onLoaded: {
root.actualCurrent = text().trim();
root.previewColourLock = false;
}
} }
Process { Process {
@ -87,14 +91,6 @@ Singleton {
} }
} }
Process {
id: setWall
property string path
command: ["caelestia", "wallpaper", "-f", path]
}
Process { Process {
running: true running: true
command: ["find", root.path, "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"] command: ["find", root.path, "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"]