Commit d7ec61c9 authored by Alexander Stippich's avatar Alexander Stippich
Browse files

Use kirigami's gridUnit for text height throughout Elisa

parent b285d75d
......@@ -48,12 +48,6 @@ FocusScope {
spacing: 0
TextMetrics {
id: titleHeight
text: viewTitle.text
font: viewTitle.font
}
// Header with title
HeaderFooterToolbar {
type: "header"
......
......@@ -25,12 +25,6 @@ RowLayout {
id: delegateRow
spacing: 0
TextMetrics {
id: metaDataLabelMetric
text: 'Metadata Name'
}
Label {
id: metaDataLabels
......
......@@ -111,11 +111,6 @@ FocusScope {
model: proxyModel
TextMetrics {
id: secondaryLabelSize
text: 'example'
}
ScrollHelper {
id: scrollHelper
flickable: contentDirectoryView
......@@ -141,7 +136,7 @@ FocusScope {
}
cellWidth: Math.floor(availableWidth / Math.max(Math.floor(availableWidth / elisaTheme.gridDelegateSize), 2))
cellHeight: elisaTheme.gridDelegateSize + secondaryLabelSize.boundingRect.height * 2 + Kirigami.Units.largeSpacing
cellHeight: elisaTheme.gridDelegateSize + Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing
delegate: GridBrowserDelegate {
width: elisaTheme.gridDelegateSize
......
......@@ -103,12 +103,6 @@ FocusScope {
text: mainLabel.text
}
TextMetrics {
id: secondaryLabelSize
font: secondaryLabel.font
text: secondaryLabel.text
}
ColumnLayout {
id: mainData
......@@ -292,9 +286,7 @@ FocusScope {
Layout.maximumWidth: gridEntry.width * 0.9
Layout.minimumWidth: Layout.maximumWidth
Layout.maximumHeight: delegateDisplaySecondaryText
? (mainLabelSize.boundingRect.height - mainLabelSize.boundingRect.y)
: (mainLabelSize.boundingRect.height - mainLabelSize.boundingRect.y) * 2
Layout.maximumHeight: delegateDisplaySecondaryText ? mainLabelSize.boundingRect.height : mainLabelSize.boundingRect.height * 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: delegateDisplaySecondaryText ? 0 : Kirigami.Units.smallSpacing
......
......@@ -114,11 +114,6 @@ FocusScope {
Accessible.role: Accessible.List
Accessible.name: mainTitle
TextMetrics {
id: secondaryLabelSize
text: 'example'
}
ScrollHelper {
id: scrollHelper
flickable: contentDirectoryView
......@@ -126,7 +121,7 @@ FocusScope {
}
cellWidth: Math.floor(availableWidth / Math.max(Math.floor(availableWidth / elisaTheme.gridDelegateSize), 2))
cellHeight: elisaTheme.gridDelegateSize + secondaryLabelSize.boundingRect.height * 2 + Kirigami.Units.largeSpacing
cellHeight: elisaTheme.gridDelegateSize + Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing
delegate: GridBrowserDelegate {
width: elisaTheme.gridDelegateSize
......
......@@ -55,14 +55,8 @@ FocusScope {
Keys.onReturnPressed: enqueue(trackUrl, dataType, title)
Keys.onEnterPressed: enqueue(trackUrl, dataType, title)
TextMetrics {
id: mainLabelSize
font: mainLabel.font
text: mainLabel.text
}
property int singleLineHeight: 3 * Kirigami.Units.smallSpacing + mainLabelSize.height
height: singleLineHeight + (detailedView ? mainLabelSize.height : 0)
property int singleLineHeight: 3 * Kirigami.Units.smallSpacing + Kirigami.Units.gridUnit
height: singleLineHeight + (detailedView ? Kirigami.Units.gridUnit : 0)
Rectangle {
id: rowRoot
......
......@@ -116,7 +116,7 @@ FocusScope {
Layout.fillHeight: true
Layout.rightMargin: !LayoutMirroring.enabled ? Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing * 2
Layout.leftMargin: LayoutMirroring.enabled ? Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing * 2
Layout.preferredWidth: (durationTextMetrics.boundingRect.width - durationTextMetrics.boundingRect.x) + 5
Layout.preferredWidth: (durationTextMetrics.boundingRect.width - durationTextMetrics.boundingRect.x) + Kirigami.Units.smallSpacing
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignRight
......
......@@ -25,13 +25,7 @@ RowLayout {
id: delegateRow
spacing: 0
height: (model.type === EditableTrackMetadataModel.LongTextEntry ? longTextDisplayLoader.height : (metaDataLabelMetric.boundingRect.height + Kirigami.Units.smallSpacing / 2))
TextMetrics {
id: metaDataLabelMetric
text: 'Metadata Name'
}
height: (model.type === EditableTrackMetadataModel.LongTextEntry ? longTextDisplayLoader.height : (Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing / 2))
Label {
id: metaDataLabels
......
......@@ -57,18 +57,12 @@ FocusScope {
Accessible.role: Accessible.ListItem
Accessible.name: title + ' ' + album + ' ' + artist
TextMetrics {
id: mainCompactLabelSize
font: mainCompactLabel.font
text: mainCompactLabel.text
}
Keys.onReturnPressed: {
playListEntry.switchToTrack(playListEntry.index)
playListEntry.startPlayback()
}
height: mainCompactLabelSize.height + 3 * Kirigami.Units.smallSpacing
height: Kirigami.Units.gridUnit + 3 * Kirigami.Units.smallSpacing
Loader {
id: metadataLoader
......
......@@ -23,13 +23,7 @@ Rectangle {
property int discNumber
color: myPalette.mid
height: discHeaderSize.height + Kirigami.Units.largeSpacing
TextMetrics {
id: discHeaderSize
font: discHeaderLabel.font
text: discHeaderLabel.text
}
height: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing
LabelWithToolTip {
id: discHeaderLabel
......
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