From 84a87a37e3589043a7c698f45c2463d167b026a9 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 23 Aug 2025 14:51:03 +0800 Subject: Mpris: albumArt with tint of accent colors --- bar/Mpris.qml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bar/Mpris.qml b/bar/Mpris.qml index 7d14ba4..e2f0e7b 100644 --- a/bar/Mpris.qml +++ b/bar/Mpris.qml @@ -112,12 +112,26 @@ Item { anchors.fill: parent radius: 6 color: "transparent" - Image { + child: Image { + id: albumArt // IconImage makes it less crisp and blurry anchors.fill: parent source: activePlayer?.trackArtUrl || Quickshell.iconPath(AppSearch.guessIcon(activePlayer?.desktopEntry), "image-missing") antialiasing: true asynchronous: true + ColorOverlay { + property color rawColor: activePlayer?.playbackState === MprisPlaybackState.Playing ? Colors.background1 : Colors.background2 + anchors.fill: albumArt + source: albumArt + color: Qt.rgba(rawColor.r, rawColor.g, rawColor.b, General.accentTransparency) + + Behavior on color { + ColorAnimation { + duration: General.animationDuration / 4 + easing.type: Easing.InOutQuad + } + } + } } } -- cgit v1.2.3