diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-16 00:37:31 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-16 00:46:52 +0800 |
| commit | 3352b13c1116764e30d464226b0dfc8423a0c295 (patch) | |
| tree | f5f162597e616503d1390db46d0c931f912ea8aa | |
| parent | a99a595ed3fda535e53f4aa455a57ff87d6122a5 (diff) | |
mpris: better pause look
| -rw-r--r-- | bar/Mpris.qml | 20 | ||||
| -rw-r--r-- | config/Bar.qml | 2 |
2 files changed, 22 insertions, 0 deletions
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 } |
