OSD: font cleanup

Vertical Media Player OSD is still very bad / useless.
This commit is contained in:
Lemmy
2026-01-17 10:58:55 -05:00
parent 08d2a41181
commit 60792521e1
+6 -14
View File
@@ -412,9 +412,8 @@ Variants {
id: lockKeyTextMetrics
visible: false
text: root.getDisplayPercentage()
pointSize: Style.fontSizeM
pointSize: Style.fontSizeS
family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightMedium
elide: Text.ElideNone
wrapMode: Text.NoWrap
}
@@ -442,7 +441,7 @@ Variants {
const textWidth = Math.ceil(lockKeyTextMetrics.contentWidth || 0);
if (textWidth === 0) {
// Fallback: estimate based on text length if measurement not ready
const fontSize = Style.fontSizeM * Settings.data.ui.fontFixedScale * Style.uiScaleRatio;
const fontSize = Style.fontSizeS * Settings.data.ui.fontFixedScale * Style.uiScaleRatio;
const estimatedWidth = text.length * fontSize * 0.6;
const iconWidth = Style.fontSizeXL * Style.uiScaleRatio;
const margins = Style.marginL * 2;
@@ -471,7 +470,7 @@ Variants {
}
// Calculate height: font size * char count + margins + icon space
// Font size M (11pt) scaled, plus some spacing between chars
const fontSize = Style.fontSizeM * Settings.data.ui.fontFixedScale * Style.uiScaleRatio;
const fontSize = Style.fontSizeS * Settings.data.ui.fontFixedScale * Style.uiScaleRatio;
const charHeight = fontSize * 1.3; // Add 30% for line height (matches Layout.preferredHeight)
const textHeight = charCount * charHeight;
// Background margins (Style.marginM * 1.5 * 2 for top and bottom)
@@ -602,7 +601,6 @@ Variants {
TextMetrics {
id: percentageMetrics
font.family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightMedium
font.pointSize: Style.fontSizeS * (Settings.data.ui.fontFixedScale * Style.uiScaleRatio)
text: "150%"
}
@@ -627,9 +625,7 @@ Variants {
visible: root.currentOSDType === OSD.Type.LockKey
text: root.getDisplayPercentage()
color: root.getProgressColor()
pointSize: Style.fontSizeM
family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightMedium
pointSize: Style.fontSizeS
elide: Text.ElideNone
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
@@ -642,7 +638,6 @@ Variants {
text: root.getDisplayPercentage()
color: Color.mOnSurface
pointSize: Style.fontSizeS
font.weight: Style.fontWeightRegular
horizontalAlignment: Text.AlignLeft
elide: Text.ElideRight
Layout.fillWidth: true
@@ -749,12 +744,11 @@ Variants {
NText {
text: modelData || ""
color: root.getProgressColor()
pointSize: Style.fontSizeM
pointSize: Style.fontSizeS
family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightMedium
Layout.fillWidth: true
Layout.preferredHeight: {
const fontSize = Style.fontSizeM * Settings.data.ui.fontFixedScale * Style.uiScaleRatio;
const fontSize = Style.fontSizeS * Settings.data.ui.fontFixedScale * Style.uiScaleRatio;
return Math.round(fontSize * 1.3);
}
Layout.alignment: Qt.AlignHCenter
@@ -770,7 +764,6 @@ Variants {
color: Color.mOnSurface
pointSize: Style.fontSizeS
family: Settings.data.ui.fontFixed
font.weight: Style.fontWeightRegular
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
@@ -783,7 +776,6 @@ Variants {
text: root.getDisplayPercentage()
color: Color.mOnSurface
pointSize: Style.fontSizeXS
font.weight: Style.fontWeightRegular
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight