diff --git a/src/qml/BaseTheme.qml b/src/qml/BaseTheme.qml --- a/src/qml/BaseTheme.qml +++ b/src/qml/BaseTheme.qml @@ -56,7 +56,7 @@ FontMetrics { id: playListAlbumTextHeight font.weight: Font.Bold - font.pointSize: elisaTheme.defaultFontPointSize * 1.4 + font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) } FontMetrics { @@ -106,12 +106,6 @@ property alias defaultFontPointSize: fontSize.font.pointSize - TextMetrics { - id: bigTextSize - font.pointSize: defaultFontPointSize * 1.4 - text: "Albums" - } - property int viewSelectorSmallSizeThreshold: 800 Label { diff --git a/src/qml/BasicPlayListAlbumHeader.qml b/src/qml/BasicPlayListAlbumHeader.qml --- a/src/qml/BasicPlayListAlbumHeader.qml +++ b/src/qml/BasicPlayListAlbumHeader.qml @@ -50,8 +50,8 @@ id: mainIcon property int layoutMargin: headerRow.height - elisaTheme.smallDelegateToolButtonSize - - trackNumberSize.width - - fakeDiscNumberSize.width - + (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) - + (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) - (elisaTheme.layoutHorizontalMargin * 5 / 4) source: (imageUrl != '' ? imageUrl : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) @@ -89,7 +89,7 @@ text: album font.weight: Font.Bold - font.pointSize: elisaTheme.defaultFontPointSize * 1.4 + font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) horizontalAlignment: Text.AlignLeft diff --git a/src/qml/ContextView.qml b/src/qml/ContextView.qml --- a/src/qml/ContextView.qml +++ b/src/qml/ContextView.qml @@ -47,11 +47,7 @@ TextMetrics { id: titleHeight text: viewTitleHeight.text - font - { - pointSize: viewTitleHeight.font.pointSize - bold: viewTitleHeight.font.bold - } + font: viewTitleHeight.font } LabelWithToolTip { @@ -62,7 +58,7 @@ Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.topMargin: elisaTheme.layoutVerticalMargin * 3 - Layout.bottomMargin: titleHeight.height + Layout.bottomMargin: titleHeight.boundingRect.height - titleHeight.boundingRect.y } Image { @@ -102,7 +98,7 @@ text: (artistName && albumName ? i18nc('display of artist and album in context view', 'by %1 from %2', artistName, albumName) : '') - font.pointSize: elisaTheme.defaultFontPointSize * 1.4 + font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) visible: artistName !== '' && albumName !== '' @@ -117,7 +113,7 @@ text: (albumName ? i18nc('display of album in context view', 'from %1', albumName) : '') - font.pointSize: elisaTheme.defaultFontPointSize * 1.4 + font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) visible: artistName === '' && albumName !== '' @@ -132,7 +128,7 @@ text: (artistName ? i18nc('display of artist in context view', 'by %1', artistName) : '') - font.pointSize: elisaTheme.defaultFontPointSize * 1.4 + font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) visible: artistName !== '' && albumName === '' diff --git a/src/qml/FileBrowserDelegate.qml b/src/qml/FileBrowserDelegate.qml --- a/src/qml/FileBrowserDelegate.qml +++ b/src/qml/FileBrowserDelegate.qml @@ -101,7 +101,8 @@ hoverEnabled: true acceptedButtons: Qt.LeftButton - Layout.preferredHeight: fileDelegate.width * 0.85 + elisaTheme.layoutVerticalMargin * 0.5 + mainLabelSize.height + Layout.preferredHeight: fileDelegate.width * 0.85 + elisaTheme.layoutVerticalMargin * 0.5 + + (mainLabelSize.boundingRect.height - mainLabelSize.boundingRect.y) Layout.fillWidth: true onClicked: fileDelegate.selected() @@ -195,7 +196,7 @@ Layout.topMargin: elisaTheme.layoutVerticalMargin * 0.5 Layout.preferredWidth: fileDelegate.width * 0.85 - Layout.maximumHeight: mainLabelSize.height * 2 + Layout.maximumHeight: (mainLabelSize.boundingRect.height - mainLabelSize.boundingRect.y) * 2 Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom text: fileName diff --git a/src/qml/GridBrowserDelegate.qml b/src/qml/GridBrowserDelegate.qml --- a/src/qml/GridBrowserDelegate.qml +++ b/src/qml/GridBrowserDelegate.qml @@ -53,7 +53,9 @@ hoverEnabled: true acceptedButtons: Qt.LeftButton - Layout.preferredHeight: gridEntry.width * 0.85 + elisaTheme.layoutVerticalMargin * 0.5 + mainLabelSize.height + secondaryLabelSize.height + Layout.preferredHeight: gridEntry.width * 0.85 + elisaTheme.layoutVerticalMargin * 0.5 + + (mainLabelSize.boundingRect.height - mainLabelSize.boundingRect.y) + + (secondaryLabelSize.boundingRect.height - secondaryLabelSize.boundingRect.y) Layout.fillWidth: true onClicked: { diff --git a/src/qml/GridBrowserView.qml b/src/qml/GridBrowserView.qml --- a/src/qml/GridBrowserView.qml +++ b/src/qml/GridBrowserView.qml @@ -125,7 +125,9 @@ } cellWidth: elisaTheme.gridDelegateWidth - cellHeight: (delegateDisplaySecondaryText ? elisaTheme.gridDelegateHeight : elisaTheme.gridDelegateHeight - secondaryLabelSize.height) + cellHeight: delegateDisplaySecondaryText ? + elisaTheme.gridDelegateHeight : + elisaTheme.gridDelegateHeight - (secondaryLabelSize.boundingRect.height - secondaryLabelSize.boundingRect.y) delegate: GridBrowserDelegate { width: contentDirectoryView.cellWidth diff --git a/src/qml/MediaPlayListView.qml b/src/qml/MediaPlayListView.qml --- a/src/qml/MediaPlayListView.qml +++ b/src/qml/MediaPlayListView.qml @@ -103,16 +103,6 @@ anchors.fill: parent spacing: 0 - TextMetrics { - id: titleHeight - text: viewTitleHeight.text - font - { - pointSize: viewTitleHeight.font.pointSize - bold: viewTitleHeight.font.bold - } - } - LabelWithToolTip { id: viewTitleHeight text: i18nc("Title of the view of the playlist", "Playlist") diff --git a/src/qml/MediaPlayerControl.qml b/src/qml/MediaPlayerControl.qml --- a/src/qml/MediaPlayerControl.qml +++ b/src/qml/MediaPlayerControl.qml @@ -200,7 +200,7 @@ Layout.fillHeight: true Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : elisaTheme.layoutHorizontalMargin * 2 Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : elisaTheme.layoutHorizontalMargin * 2 - Layout.preferredWidth: durationTextMetrics.width+5 // be in the safe side + Layout.preferredWidth: (durationTextMetrics.boundingRect.width - durationTextMetrics.boundingRect.x) + 5 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignRight @@ -288,7 +288,7 @@ Layout.fillHeight: true Layout.rightMargin: !LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin * 2) : 0 Layout.leftMargin: LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin * 2) : 0 - Layout.preferredWidth: durationTextMetrics.width + Layout.preferredWidth: (durationTextMetrics.boundingRect.width - durationTextMetrics.boundingRect.x) verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft diff --git a/src/qml/MediaTrackDelegate.qml b/src/qml/MediaTrackDelegate.qml --- a/src/qml/MediaTrackDelegate.qml +++ b/src/qml/MediaTrackDelegate.qml @@ -329,11 +329,6 @@ Layout.rightMargin: elisaTheme.layoutHorizontalMargin } - TextMetrics { - id: durationTextMetrics - text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00") - } - LabelWithToolTip { id: durationLabel @@ -347,7 +342,6 @@ Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 - Layout.preferredWidth: durationTextMetrics.width + 1 } } } diff --git a/src/qml/MetaDataDelegate.qml b/src/qml/MetaDataDelegate.qml --- a/src/qml/MetaDataDelegate.qml +++ b/src/qml/MetaDataDelegate.qml @@ -25,7 +25,8 @@ id: delegateRow spacing: 0 - height: (model.type === TrackMetadataModel.LongTextEntry ? longTextDisplayLoader.height : metaDataLabelMetric.height) + (elisaTheme.layoutVerticalMargin / 2) + height: (model.type === TrackMetadataModel.LongTextEntry ? longTextDisplayLoader.height : (metaDataLabelMetric.boundingRect.height - metaDataLabelMetric.boundingRect.y)) + + (elisaTheme.layoutVerticalMargin / 2) TextMetrics { id: metaDataLabelMetric diff --git a/src/qml/NavigationActionBar.qml b/src/qml/NavigationActionBar.qml --- a/src/qml/NavigationActionBar.qml +++ b/src/qml/NavigationActionBar.qml @@ -132,13 +132,6 @@ Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 - TextMetrics { - id: albumTextSize - text: albumLabel.text - font.pointSize: albumLabel.font.pointSize - font.bold: albumLabel.font.bold - } - LabelWithToolTip { id: albumLabel @@ -162,13 +155,6 @@ } } - TextMetrics { - id: authorTextSize - text: authorLabel.text - font.pointSize: authorLabel.font.pointSize - font.bold: authorLabel.font.bold - } - LabelWithToolTip { id: authorLabel @@ -289,8 +275,8 @@ Layout.bottomMargin: 0 Layout.fillWidth: true - Layout.minimumWidth: placeHolderTextWidth.width * 1.2 - implicitWidth: placeHolderTextWidth.width * 1.2 + Layout.minimumWidth: (placeHolderTextWidth.boundingRect.width - placeHolderTextWidth.boundingRect.x) * 1.2 + implicitWidth: (placeHolderTextWidth.boundingRect.width - placeHolderTextWidth.boundingRect.x) * 1.2 TextMetrics { id: placeHolderTextWidth diff --git a/src/qml/PlayListEntry.qml b/src/qml/PlayListEntry.qml --- a/src/qml/PlayListEntry.qml +++ b/src/qml/PlayListEntry.qml @@ -178,9 +178,9 @@ visible: isValid && (!hasValidDiscNumber || isSingleDiscAlbum) - Layout.preferredWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) - Layout.minimumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) - Layout.maximumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) + Layout.preferredWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) + Layout.minimumWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) + Layout.maximumWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) TextMetrics { id: fakeDiscNumberSize @@ -203,9 +203,9 @@ visible: isValid - Layout.preferredWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) - Layout.minimumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) - Layout.maximumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) + Layout.preferredWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) + Layout.minimumWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) + Layout.maximumWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) Layout.rightMargin: !LayoutMirroring.enabled ? (discNumber !== 0 && !isSingleDiscAlbum ? 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 @@ -237,9 +237,9 @@ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter - Layout.preferredWidth: numberSeparatorSize.width - Layout.minimumWidth: numberSeparatorSize.width - Layout.maximumWidth: numberSeparatorSize.width + Layout.preferredWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) + Layout.minimumWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) + Layout.maximumWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) TextMetrics { id: numberSeparatorSize @@ -260,9 +260,15 @@ Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - Layout.preferredWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) - Layout.minimumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) - Layout.maximumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) + Layout.preferredWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? + (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : + (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) + Layout.minimumWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? + (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : + (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) + Layout.maximumWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? + (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : + (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) Layout.rightMargin: !LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 Layout.leftMargin: LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 @@ -380,11 +386,6 @@ visible: rating > 0 } - TextMetrics { - id: durationTextMetrics - text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00") - } - LabelWithToolTip { id: durationLabel @@ -394,7 +395,6 @@ color: myPalette.text Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - Layout.preferredWidth: durationTextMetrics.width + 1 Layout.leftMargin: elisaTheme.layoutHorizontalMargin / 2 Layout.rightMargin: elisaTheme.layoutHorizontalMargin / 2 diff --git a/src/qml/SimplePlayListEntry.qml b/src/qml/SimplePlayListEntry.qml --- a/src/qml/SimplePlayListEntry.qml +++ b/src/qml/SimplePlayListEntry.qml @@ -108,15 +108,15 @@ Layout.preferredHeight: headerRow.height Layout.leftMargin: !LayoutMirroring.enabled ? (elisaTheme.smallDelegateToolButtonSize + - trackNumberSize.width + - fakeDiscNumberSize.width + + (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) + + (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin * 5 / 4) - headerRow.height) : 0 Layout.rightMargin: LayoutMirroring.enabled ? (elisaTheme.smallDelegateToolButtonSize + - trackNumberSize.width + - fakeDiscNumberSize.width + + (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) + + (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin * 5 / 4) - headerRow.height) : 0 @@ -147,7 +147,7 @@ text: album font.weight: Font.Bold - font.pointSize: elisaTheme.defaultFontPointSize * 1.4 + font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) color: myPalette.highlightedText horizontalAlignment: Text.AlignLeft @@ -246,9 +246,9 @@ visible: isValid && (!hasValidDiscNumber || isSingleDiscAlbum) - Layout.preferredWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) - Layout.minimumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) - Layout.maximumWidth: fakeDiscNumberSize.width + (elisaTheme.layoutHorizontalMargin / 4) + Layout.preferredWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) + Layout.minimumWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) + Layout.maximumWidth: (fakeDiscNumberSize.boundingRect.width - fakeDiscNumberSize.boundingRect.x) + (elisaTheme.layoutHorizontalMargin / 4) TextMetrics { id: fakeDiscNumberSize @@ -271,9 +271,15 @@ visible: isValid - Layout.preferredWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) - Layout.minimumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) - Layout.maximumWidth: (trackNumberSize.width > realTrackNumberSize.width ? trackNumberSize.width : realTrackNumberSize.width) + Layout.preferredWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? + (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : + (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) + Layout.minimumWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? + (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : + (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) + Layout.maximumWidth: ((trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) > (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x) ? + (trackNumberSize.boundingRect.width - trackNumberSize.boundingRect.x) : + (realTrackNumberSize.boundingRect.width - realTrackNumberSize.boundingRect.x)) Layout.rightMargin: !LayoutMirroring.enabled ? (discNumber !== 0 && !isSingleDiscAlbum ? 0 : elisaTheme.layoutHorizontalMargin / 2) : 0 @@ -305,9 +311,9 @@ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter - Layout.preferredWidth: numberSeparatorSize.width - Layout.minimumWidth: numberSeparatorSize.width - Layout.maximumWidth: numberSeparatorSize.width + Layout.preferredWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) + Layout.minimumWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) + Layout.maximumWidth: (numberSeparatorSize.boundingRect.width - numberSeparatorSize.boundingRect.x) TextMetrics { id: numberSeparatorSize @@ -328,9 +334,15 @@ Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - Layout.preferredWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) - Layout.minimumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) - Layout.maximumWidth: (discNumberSize.width > realDiscNumberSize.width ? discNumberSize.width : realDiscNumberSize.width) + Layout.preferredWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? + (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : + (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) + Layout.minimumWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? + (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : + (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) + Layout.maximumWidth: ((discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) > (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x) ? + (discNumberSize.boundingRect.width - discNumberSize.boundingRect.x) : + (realDiscNumberSize.boundingRect.width - realDiscNumberSize.boundingRect.x)) Layout.rightMargin: !LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 Layout.leftMargin: LayoutMirroring.enabled ? (elisaTheme.layoutHorizontalMargin / 2) : 0 @@ -395,11 +407,6 @@ starSize: elisaTheme.ratingStarSize } - TextMetrics { - id: durationTextMetrics - text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00") - } - LabelWithToolTip { id: durationLabel @@ -409,7 +416,6 @@ color: myPalette.highlightedText Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - Layout.preferredWidth: durationTextMetrics.width + 1 Layout.leftMargin: elisaTheme.layoutHorizontalMargin / 2 Layout.rightMargin: elisaTheme.layoutHorizontalMargin / 2 diff --git a/src/qml/TopNotificationItem.qml b/src/qml/TopNotificationItem.qml --- a/src/qml/TopNotificationItem.qml +++ b/src/qml/TopNotificationItem.qml @@ -51,7 +51,7 @@ Label { id: notificationText - font.pointSize: elisaTheme.defaultFontPoinPoint * 1.5 + font.pointSize: Math.round(elisaTheme.defaultFontPoinPoint * 1.5) Layout.leftMargin: elisaTheme.layoutHorizontalMargin Layout.alignment: Qt.AlignHCenter diff --git a/src/qml/TrackImportNotification.qml b/src/qml/TrackImportNotification.qml --- a/src/qml/TrackImportNotification.qml +++ b/src/qml/TrackImportNotification.qml @@ -29,7 +29,7 @@ color: myPalette.highlight - width: Math.max(elisaTheme.gridDelegateWidth * 1.5, labelWidth.width + 2 * elisaTheme.layoutHorizontalMargin) + + width: Math.max(elisaTheme.gridDelegateWidth * 1.5, (labelWidth.boundingRect.width - labelWidth.boundingRect.x) + 2 * elisaTheme.layoutHorizontalMargin) + elisaTheme.smallControlButtonSize * 1.5 + 3 * elisaTheme.layoutHorizontalMargin height: elisaTheme.smallControlButtonSize * 1.5 + 2 * elisaTheme.layoutHorizontalMargin diff --git a/src/qml/ViewSelector.qml b/src/qml/ViewSelector.qml --- a/src/qml/ViewSelector.qml +++ b/src/qml/ViewSelector.qml @@ -163,7 +163,7 @@ anchors.rightMargin: elisaTheme.layoutHorizontalMargin verticalAlignment: "AlignVCenter" - font.pointSize: elisaTheme.defaultFontPointSize * 1.1 + font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.1) text: model.display elide: Text.ElideRight