mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
MediaPlayerPanel: improve the album artwork
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user