diff options
Diffstat (limited to 'desktop/modules/sound/Osd.qml')
| -rw-r--r-- | desktop/modules/sound/Osd.qml | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/desktop/modules/sound/Osd.qml b/desktop/modules/sound/Osd.qml index 4a5e4a2..2894d35 100644 --- a/desktop/modules/sound/Osd.qml +++ b/desktop/modules/sound/Osd.qml @@ -13,6 +13,7 @@ import Quickshell import Quickshell.Wayland import Quickshell.Services.Pipewire import QtQuick +import QtQuick.Effects import "../.." // The transient on-screen display. Unchanged in behaviour from volume-osd, @@ -82,6 +83,55 @@ Scope { border.width: 1 border.color: Qt.alpha(Theme.text, 0.12) + // Album art as the whole background, lightly blurred, when the + // player has any. It is opaque, so it hides the compositor's + // frosting; without art the panel keeps the translucent look. + // Inset by the border width so the border stays visible. + Image { + id: bgArt + anchors.fill: parent + anchors.margins: 1 + source: Player.active ? Player.artUrl : "" + cache: false + asynchronous: true + fillMode: Image.PreserveAspectCrop + visible: false + } + + // clip only cuts to the bounding box, so the corners come from a + // mask the size of the art with the panel's radius. + Rectangle { + id: bgMask + anchors.fill: bgArt + radius: parent.radius - 1 + layer.enabled: true + visible: false + } + + MultiEffect { + id: bgEffect + anchors.fill: bgArt + visible: bgArt.status === Image.Ready && bgArt.source != "" + source: bgArt + autoPaddingEnabled: false + blurEnabled: true + blur: 0.5 + maskEnabled: true + maskSource: bgMask + maskThresholdMin: 0.5 + maskSpreadAtMin: 1.0 + } + + // Keeps text and the accent bar legible on a bright cover. A + // sibling, not a child: nested inside the MultiEffect it did not + // paint, and a light cover showed through at full brightness. + Rectangle { + anchors.fill: bgArt + visible: bgEffect.visible + radius: bgMask.radius + color: Qt.alpha(Theme.base, 0.82) + } + HoverHandler { onHoveredChanged: root.hovered = hovered } |
