Commit 00cd96a6 authored by Tranter Madi's avatar Tranter Madi 🌧
Browse files

Improve Playlist's album header

- Fix binding loop
- Use fixed height for sections
- Make the section's image fill all the height
parent d8fade12
Pipeline #60950 passed with stage
in 8 minutes and 35 seconds
......@@ -29,8 +29,6 @@ Item {
property int hairline: Math.floor(Kirigami.Units.devicePixelRatio)
property int playListAlbumArtSize: 60
property int coverImageSize: 180
property int contextCoverImageSize: 100
property int smallImageSize: 32
......
......@@ -29,23 +29,20 @@ Rectangle {
RowLayout {
id: contentLayout
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
// No bottom anchor so it can grow vertically
width: parent.width
spacing: Kirigami.Units.smallSpacing
ImageWithFallback {
Layout.preferredWidth: elisaTheme.playListAlbumArtSize
Layout.preferredHeight: elisaTheme.playListAlbumArtSize
Layout.preferredWidth: height
Layout.fillHeight: true
Layout.margins: Kirigami.Units.largeSpacing
source: imageUrl
fallback: elisaTheme.defaultAlbumImage
sourceSize.width: elisaTheme.playListAlbumArtSize
sourceSize.height: elisaTheme.playListAlbumArtSize
sourceSize.width: height
sourceSize.height: height
fillMode: Image.PreserveAspectFit
asynchronous: true
......@@ -55,7 +52,8 @@ Rectangle {
id: albumHeaderTextColumn
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: background.ListView.view.sectionSizer.implicitHeight
Layout.leftMargin: !LayoutMirroring.enabled ? - Kirigami.Units.smallSpacing : 0
Layout.rightMargin: LayoutMirroring.enabled ? - Kirigami.Units.smallSpacing : 0
Layout.topMargin: Kirigami.Units.smallSpacing
......@@ -89,7 +87,7 @@ Rectangle {
elide: Text.ElideRight
wrapMode: Text.WordWrap
maximumLineCount: 2
maximumLineCount: 3 - mainLabel.lineCount
}
}
}
......
......@@ -197,6 +197,7 @@ Kirigami.Page {
property alias list: playListView
ListView {
id: playListView
readonly property alias sectionSizer: sectionSizer
focus: true
clip: true
......@@ -366,6 +367,16 @@ Kirigami.Page {
onTriggered: playListNotification.visible = false
}
}
// calculate a fixed hight for section delegates
// workaround for QTBUG-52595
Column {
id: sectionSizer
visible: false
spacing: Kirigami.Units.smallSpacing
LabelWithToolTip { text: "M\nM"; level: 2 }
LabelWithToolTip { text: "M" }
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment