dashboard: fix media cover art

This commit is contained in:
2 * r + 2 * t 2025-05-19 15:42:51 +08:00
parent 55d5bc7f37
commit a4bd60c907

View file

@ -1,8 +1,8 @@
import "root:/widgets" import "root:/widgets"
import "root:/services" import "root:/services"
import "root:/config" import "root:/config"
import Quickshell.Widgets
import QtQuick import QtQuick
import QtQuick.Effects
import QtQuick.Shapes import QtQuick.Shapes
Item { Item {
@ -83,7 +83,7 @@ Item {
} }
} }
StyledRect { ClippingRectangle {
id: cover id: cover
anchors.top: parent.top anchors.top: parent.top
@ -108,29 +108,19 @@ Item {
anchors.fill: parent anchors.fill: parent
visible: false
source: Players.active?.trackArtUrl ?? "" source: Players.active?.trackArtUrl ?? ""
asynchronous: true asynchronous: true
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
sourceSize.width: width
sourceSize.height: height
} }
Rectangle { Behavior on color {
id: mask ColorAnimation {
duration: Appearance.anim.durations.normal
layer.enabled: true easing.type: Easing.BezierSpline
layer.smooth: true easing.bezierCurve: Appearance.anim.curves.standard
visible: false
anchors.fill: image
radius: parent.radius
} }
MultiEffect {
anchors.fill: image
source: image
maskEnabled: true
maskSource: mask
maskSpreadAtMin: 1
maskThresholdMin: 0.5
} }
} }