summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bar/Mpris.qml30
1 files changed, 25 insertions, 5 deletions
diff --git a/bar/Mpris.qml b/bar/Mpris.qml
index 3e75d7a..8a612c2 100644
--- a/bar/Mpris.qml
+++ b/bar/Mpris.qml
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
+import Qt5Compat.GraphicalEffects
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Mpris
@@ -72,11 +73,30 @@ Item {
id: layout
anchors.centerIn: parent
spacing: Bar.resourceIconTextSpacing / 1.5
- Image {
- source: activePlayer.trackArtUrl
- fillMode: Image.PreserveAspectFit
- Layout.preferredWidth: Bar.appIconSize
- cache: true
+ Item {
+ Layout.preferredWidth: childrenRect.width
+ Layout.preferredHeight: childrenRect.height
+ width: Bar.appIconSize
+ height: Bar.appIconSize
+ Image {
+ id: image
+ anchors.fill: parent
+ source: activePlayer?.trackArtUrl
+ fillMode: Image.PreserveAspectFit
+ cache: true
+ visible: false
+ }
+ Rectangle {
+ id: mask
+ anchors.fill: parent
+ radius: 6
+ visible: false
+ }
+ OpacityMask {
+ anchors.fill: parent
+ source: image
+ maskSource: mask
+ }
}
IText {
animate: true