mpris menu: proper album art with gradient fade
This commit is contained in:
parent
66dc628752
commit
a69507980b
1 changed files with 22 additions and 10 deletions
|
|
@ -9,23 +9,35 @@ M.PopupPanel {
|
||||||
|
|
||||||
required property MprisPlayer player
|
required property MprisPlayer player
|
||||||
|
|
||||||
// Album art placeholder (or real art if available)
|
// Album art
|
||||||
Rectangle {
|
Item {
|
||||||
width: menuWindow.panelWidth
|
width: menuWindow.panelWidth
|
||||||
height: 80
|
height: _artImg.status === Image.Ready ? 140 : 60
|
||||||
color: M.Theme.base02
|
clip: true
|
||||||
radius: M.Theme.radius
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: M.Theme.base02
|
||||||
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
id: _artImg
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: menuWindow.player?.trackArtUrl ?? ""
|
source: menuWindow.player?.trackArtUrl ?? ""
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
visible: status === Image.Ready
|
visible: status === Image.Ready
|
||||||
|
}
|
||||||
|
|
||||||
// Round top corners to match panel
|
// Gradient fade at the bottom so art blends into the panel
|
||||||
layer.enabled: true
|
Rectangle {
|
||||||
layer.effect: Item {
|
anchors.left: parent.left
|
||||||
// simple clip — the panel background behind handles the rounding
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
height: 40
|
||||||
|
visible: _artImg.visible
|
||||||
|
gradient: Gradient {
|
||||||
|
GradientStop { position: 0; color: "transparent" }
|
||||||
|
GradientStop { position: 1; color: M.Theme.base01 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +48,7 @@ M.PopupPanel {
|
||||||
color: M.Theme.base04
|
color: M.Theme.base04
|
||||||
font.pixelSize: 28
|
font.pixelSize: 28
|
||||||
font.family: M.Theme.iconFontFamily
|
font.family: M.Theme.iconFontFamily
|
||||||
visible: !menuWindow.player?.trackArtUrl
|
visible: _artImg.status !== Image.Ready
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue