MediaPlayerPanel: improve the album artwork

This commit is contained in:
wxlyyy
2026-01-16 21:35:36 +08:00
parent 548007724d
commit 68035d2d80
+14 -46
View File
@@ -255,54 +255,22 @@ SmartPanel {
Layout.alignment: Qt.AlignVCenter
visible: root.showAlbumArt
Item {
NImageRounded {
anchors.fill: parent
layer.enabled: true
layer.effect: MultiEffect {
maskEnabled: true
maskSource: ShaderEffectSource {
sourceItem: maskRect
hideSource: true
}
}
radius: root.compactMode ? Style.radiusM : Style.radiusL
imagePath: MediaService.trackArtUrl
imageFillMode: Image.PreserveAspectCrop
fallbackIcon: "disc"
fallbackIconSize: root.compactMode ? Style.fontSizeXXXL * 3 : Style.fontSizeXXXL * 6
borderWidth: 0
}
Rectangle {
id: maskRect
anchors.fill: parent
radius: root.compactMode ? Style.radiusM : Style.radiusL
color: "white"
visible: false
}
Rectangle {
anchors.fill: parent
color: Color.mSurfaceVariant
}
Image {
id: albumArt
anchors.fill: parent
source: MediaService.trackArtUrl
fillMode: Image.PreserveAspectCrop
asynchronous: true
visible: root.showAlbumArt && source != ""
}
NIcon {
anchors.centerIn: parent
icon: "disc"
pointSize: root.compactMode ? Style.fontSizeXXL : (Style.fontSizeXXXL * 2)
color: Color.mOnSurfaceVariant
visible: root.showAlbumArt && albumArt.status !== Image.Ready
}
Loader {
anchors.fill: parent
anchors.margins: Style.marginS
z: 2
active: !!(root.needsCava && root.showAlbumArt)
sourceComponent: visualizerSource
}
Loader {
anchors.fill: parent
anchors.margins: Style.marginS
z: 2
active: !!(root.needsCava && root.showAlbumArt)
sourceComponent: visualizerSource
}
}