From dc7eb49e13a35583b1602305a125b239d91f1454 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 15 Jul 2025 18:04:51 +0800 Subject: mpris: rounded corner art --- bar/Mpris.qml | 30 +++++++++++++++++++++++++----- 1 file 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 -- cgit v1.2.3