From 3352b13c1116764e30d464226b0dfc8423a0c295 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 16 Jul 2025 00:37:31 +0800 Subject: mpris: better pause look --- bar/Mpris.qml | 20 ++++++++++++++++++++ config/Bar.qml | 2 ++ 2 files changed, 22 insertions(+) diff --git a/bar/Mpris.qml b/bar/Mpris.qml index 2ec644e..81a9bc8 100644 --- a/bar/Mpris.qml +++ b/bar/Mpris.qml @@ -97,9 +97,14 @@ Item { Layout.preferredHeight: childrenRect.height width: Bar.appIconSize height: Bar.appIconSize + + opacity: activePlayer.playbackState === MprisPlaybackState.Playing ? 1 : Bar.mediaPausedOpacity * 1.1 + + // put shadow Image { id: image anchors.fill: parent + source: activePlayer?.trackArtUrl fillMode: Image.PreserveAspectFit antialiasing: true @@ -118,10 +123,25 @@ Item { source: image maskSource: mask } + + Behavior on opacity { + NumberAnimation { + duration: General.animateDuration / 4 + easing.type: Easing.InOutQuad + } + } } IText { animate: true + opacity: activePlayer.playbackState === MprisPlaybackState.Playing ? 1 : Bar.mediaPausedOpacity text: root.cleanedTitle + + Behavior on opacity { + NumberAnimation { + duration: General.animateDuration / 4 + easing.type: Easing.InOutQuad + } + } } } } diff --git a/config/Bar.qml b/config/Bar.qml index a038352..39090e7 100644 --- a/config/Bar.qml +++ b/config/Bar.qml @@ -37,5 +37,7 @@ Singleton { readonly property int moduleRadius: Style.rounding.small + readonly property double mediaPausedOpacity: 0.8 + readonly property double bgTransparency: 0.25 } -- cgit v1.2.3