Make the wallpaper picker a full-screen live preview
The screen previews the selected wallpaper with the real transition (TransitionStage, now shared with the desktop background) under a frosted sheet with a 16:9 thumbnail grid. Click or arrows preview, double-click or Enter applies and switches the picker's output directly, Space peeks, typing searches. Thumbnails mark outline wallpapers (wallfx status). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b6d0da4679
commit
de9b863f3f
7 files changed
+486
-221
No files matched your search
@@ -48,11 +48,18 @@ Singleton {
|
||||
next[output] = path;
|
||||
observed = next;
|
||||
}
|
||||
function apply(path) {
|
||||
// Output -> path that switches without a change, because the picker's live
|
||||
// preview already shows it there (see WallpaperBackground).
|
||||
property var instant: ({})
|
||||
function apply(path, instantOutput) {
|
||||
const outputs = selectedMonitor === "all" ? Quickshell.screens.map(s => s.name) : [monitor];
|
||||
if (!ConfigService.ready || !ConfigService.writable || !outputs.length || !outputs[0] || busy)
|
||||
return false;
|
||||
error = "";
|
||||
const nextInstant = {};
|
||||
if (instantOutput)
|
||||
nextInstant[instantOutput] = path;
|
||||
instant = nextInstant;
|
||||
prepareTransition(path);
|
||||
// Native rendering needs no provider round trip: decode once, then switch
|
||||
// every output in one write so their transitions start together.
|
||||
@@ -108,6 +115,7 @@ Singleton {
|
||||
if (result.ok) {
|
||||
root.images = result.images;
|
||||
root.warmOutlines(result.images.map(image => image.path));
|
||||
root.refreshOutlineStatus();
|
||||
root.notice = (result.notice || "") + (result.limited ? " Showing the first 1,000 images." : "");
|
||||
} else
|
||||
root.error = result.error;
|
||||
@@ -215,6 +223,34 @@ Singleton {
|
||||
Process {
|
||||
id: warmJob
|
||||
environment: ({LD_LIBRARY_PATH: null})
|
||||
onExited: root.refreshOutlineStatus()
|
||||
}
|
||||
// Path -> "outline", "colonies" or "pending", for the picker's badges.
|
||||
property var outlineStatus: ({})
|
||||
function refreshOutlineStatus() {
|
||||
if (!outlinesAvailable || !images.length)
|
||||
return;
|
||||
if (statusJob.running)
|
||||
return void (statusJob.again = true);
|
||||
statusJob.command = [wallfxPython, Quickshell.shellPath("helpers/wallfx.py"), "status"].concat(images.map(image => image.path));
|
||||
statusJob.running = true;
|
||||
}
|
||||
Process {
|
||||
id: statusJob
|
||||
property bool again: false
|
||||
environment: ({LD_LIBRARY_PATH: null})
|
||||
stdout: StdioCollector {
|
||||
id: statusOutput
|
||||
}
|
||||
onExited: {
|
||||
try {
|
||||
root.outlineStatus = JSON.parse(statusOutput.text);
|
||||
} catch (error) {}
|
||||
if (statusJob.again) {
|
||||
statusJob.again = false;
|
||||
Qt.callLater(root.refreshOutlineStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Native backgrounds report when their new image has decoded; the reveal
|
||||
// starts on every output together once all of them are ready.
|
||||
|
||||
Reference in new issue
Block a user