summaryrefslogtreecommitdiff
path: root/bar
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-07-15 18:04:51 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-07-15 18:04:51 +0800
commitdc7eb49e13a35583b1602305a125b239d91f1454 (patch)
tree198ed745c7cc4f0834bfdacafd5551443454e1ce /bar
parentbe089dbdc687d3e0a685a1891c075f46bf2ac635 (diff)
mpris: rounded corner art
Diffstat (limited to 'bar')
-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