Commit ff598313 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

Add appropriate side margins for content in Now Playing view

BUG: 425834
FIXED-IN: 20.12.0
parent 579bd584
......@@ -118,100 +118,115 @@ FocusScope {
contentWidth: content.width
contentHeight: content.height
// Title + metadata + lyrics
ColumnLayout {
id: content
// This Item holds only the content layout so we can center the
// ColumnLayout within it to provide appropriate margins. We
// can't do this if the ColumnLayout is directly inside the
// ScrollView
Item {
width: scrollView.width - scrollView.ScrollBar.vertical.width
// Song title
LabelWithToolTip {
id: titleLabel
// Layout holding the Title + metadata + lyrics labels
ColumnLayout {
id: content
level: 1
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: Kirigami.Units.largeSpacing * 2
anchors.right: parent.right
anchors.rightMargin: Kirigami.Units.largeSpacing * 2
// No bottom anchors so it can grow
horizontalAlignment: Label.AlignHCenter
// Song title
LabelWithToolTip {
id: titleLabel
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
level: 1
Layout.topMargin: elisaTheme.layoutVerticalMargin
}
horizontalAlignment: Label.AlignHCenter
LabelWithToolTip {
id: subtitleLabel
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
text: {
if (artistName !== '' && albumName !== '') {
return i18nc("display of artist and album in context view", "<i>by</i> <b>%1</b> <i>from</i> <b>%2</b>", artistName, albumName)
} else if (artistName === '' && albumName !== '') {
return i18nc("display of album in context view", "<i>from</i> <b>%1</b>", albumName)
} else if (artistName !== '' && albumName === '') {
i18nc("display of artist in context view", "<i>by</i> <b>%1</b>", artistName)
}
Layout.topMargin: elisaTheme.layoutVerticalMargin
}
level: 3
opacity: 0.6
LabelWithToolTip {
id: subtitleLabel
text: {
if (artistName !== '' && albumName !== '') {
return i18nc("display of artist and album in context view", "<i>by</i> <b>%1</b> <i>from</i> <b>%2</b>", artistName, albumName)
} else if (artistName === '' && albumName !== '') {
return i18nc("display of album in context view", "<i>from</i> <b>%1</b>", albumName)
} else if (artistName !== '' && albumName === '') {
i18nc("display of artist in context view", "<i>by</i> <b>%1</b>", artistName)
}
}
horizontalAlignment: Label.AlignHCenter
level: 3
opacity: 0.6
visible: artistName !== '' && albumName !== ''
horizontalAlignment: Label.AlignHCenter
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
}
visible: artistName !== '' && albumName !== ''
// Horizontal line separating title and subtitle from metadata
Kirigami.Separator {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.largeSpacing* 5
Layout.rightMargin: Kirigami.Units.largeSpacing * 5
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
}
// Metadata
ColumnLayout {
id: allMetaData
// Horizontal line separating title and subtitle from metadata
Kirigami.Separator {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.largeSpacing* 5
Layout.rightMargin: Kirigami.Units.largeSpacing * 5
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
}
// Metadata
ColumnLayout {
id: allMetaData
spacing: 0
Layout.fillWidth: true
spacing: 0
Layout.fillWidth: true
//Layout.leftMargin:Kirigami.Units.largeSpacing
//Layout.rightMargin:Kirigami.Units.largeSpacing
Repeater {
id: trackData
Repeater {
id: trackData
model: metaDataModel
model: metaDataModel
delegate: MetaDataDelegate {
Layout.fillWidth: true
delegate: MetaDataDelegate {
Layout.fillWidth: true
}
}
}
}
// Horizontal line separating metadata from lyrics
Kirigami.Separator {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.largeSpacing * 5
Layout.rightMargin: Kirigami.Units.largeSpacing * 5
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
// Horizontal line separating metadata from lyrics
Kirigami.Separator {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.largeSpacing * 5
Layout.rightMargin: Kirigami.Units.largeSpacing * 5
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
visible: metaDataModel.lyrics !== ""
}
visible: metaDataModel.lyrics !== ""
}
// Lyrics
Label {
text: metaDataModel.lyrics
// Lyrics
Label {
text: metaDataModel.lyrics
wrapMode: Text.WordWrap
wrapMode: Text.WordWrap
horizontalAlignment: Label.AlignHCenter
horizontalAlignment: Label.AlignHCenter
Layout.fillWidth: true
Layout.bottomMargin: Kirigami.Units.smallSpacing
visible: metaDataModel.lyrics !== ""
Layout.fillWidth: true
Layout.bottomMargin: Kirigami.Units.smallSpacing
visible: metaDataModel.lyrics !== ""
}
}
}
}
......
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