diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-15 18:04:51 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-15 18:04:51 +0800 |
| commit | dc7eb49e13a35583b1602305a125b239d91f1454 (patch) | |
| tree | 198ed745c7cc4f0834bfdacafd5551443454e1ce /bar/Mpris.qml | |
| parent | be089dbdc687d3e0a685a1891c075f46bf2ac635 (diff) | |
mpris: rounded corner art
Diffstat (limited to 'bar/Mpris.qml')
| -rw-r--r-- | bar/Mpris.qml | 30 |
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 |
