From 9b9271c304cc7654de0320760f875b666294f591 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 29 Oct 2026 18:55:39 +0100 Subject: window-switcher: show the previews over the wallpaper, faded in The full-screen dim over the live windows is replaced by DP-1's own wallpaper, read from ~/.config/wallp/wall_h on each open and drawn opaque, so the previews sit on what looks like an empty desktop the way Mission Control does it. A light 40% Theme.base layer stays on top of it, because a bright wallpaper at full strength glared behind the previews. The overlay fades in over 220ms instead of appearing at once. The fade waits for the image to decode (or to fail, or for there to be no wallp file), otherwise Theme.base would flash first. Opacity is derived from the image status rather than starting at 1, so the initial Null status cannot play a 1-to-0 animation. Closing is still instant: fading out would keep the layer surface alive past the 60ms focus timer. Co-Authored-By: Claude Opus 5.5 --- window-switcher/Switcher.qml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'window-switcher/Switcher.qml') diff --git a/window-switcher/Switcher.qml b/window-switcher/Switcher.qml index 3bc6a86..88924d8 100644 --- a/window-switcher/Switcher.qml +++ b/window-switcher/Switcher.qml @@ -10,6 +10,7 @@ // GNU General Public License for more details. import Quickshell +import Quickshell.Io import Quickshell.Wayland import QtQuick import "Expose.js" as Expose @@ -94,9 +95,38 @@ Scope { Keys.onUpPressed: scatter.move(0, -1) Keys.onDownPressed: scatter.move(0, 1) + // The bare desktop: DP-1's wallpaper, lightly dimmed, drawn opaque over the + // real windows, so the previews sit on an empty screen rather + // than a dim. Theme.base stands in without wallp. The whole + // overlay fades in once the picture is decoded, so the real + // windows dissolve into it instead of being swapped out. Rectangle { anchors.fill: parent - color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.82) + color: Theme.base + opacity: wallImage.status === Image.Ready || wallImage.status === Image.Error || wallImage.source == "" ? 1 : 0 + Behavior on opacity { NumberAnimation { duration: 220; easing.type: Easing.OutCubic } } + + Image { + id: wallImage + anchors.fill: parent + source: wallFile.text().trim() !== "" ? "file://" + wallFile.text().trim() : "" + fillMode: Image.PreserveAspectCrop + asynchronous: true + cache: false + } + + // A light dim over the wallpaper: a bright picture at full + // strength glares behind the previews. + Rectangle { + anchors.fill: parent + color: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.4) + } + + FileView { + id: wallFile + path: Quickshell.env("HOME") + "/.config/wallp/wall_h" + blockLoading: true + } MouseArea { anchors.fill: parent -- cgit v1.2.3