battery: use theme font weight in horizontal mode

This commit is contained in:
bbedward
2026-08-23 18:39:30 -04:00
parent c9e6144de8
commit ca7b165eb8
5 changed files with 6 additions and 14 deletions
@@ -199,7 +199,7 @@ BasePill {
isMonospace: false
text: battery.horizontalSideText
reserveText: battery.horizontalSideText.replace(/\d/g, "0")
width: reservedWidth
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.barTextSize(battery.barThickness, battery.barConfig?.fontScale, battery.barConfig?.maximizeWidgetText)
color: Theme.widgetTextColor
@@ -67,7 +67,7 @@ BasePill {
isMonospace: false
text: WeatherService.currentTempText(false)
reserveText: text.replace(/\d/g, "0")
width: reservedWidth
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.widgetTextColor
@@ -120,11 +120,10 @@ Item {
isMonospace: false
text: root.timeText
reserveText: root.timeText.replace(/\d/g, "0")
width: reservedWidth
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
color: Theme.surfaceText
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.DemiBold
}
ClusterDot {
@@ -147,7 +146,6 @@ Item {
text: root.dateText
color: Theme.surfaceTextMedium
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
}
}
}
@@ -220,7 +218,6 @@ Item {
text: WeatherService.currentTempText()
color: Theme.surfaceTextSecondary
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
}
}
@@ -25,7 +25,7 @@ Item {
readonly property real measuredWidth: {
let width = Theme.spacingS + root.artworkSize + Theme.spacingXS + root.cavaWidth + Theme.spacingXS + root.naturalTextWidth + Theme.spacingXS;
if (root.clockVisible)
width += clockText.reservedWidth + Theme.spacingXS * 2 + Theme.spacingS;
width += clockText.width + Theme.spacingXS * 2 + Theme.spacingS;
return width;
}
@@ -128,7 +128,7 @@ Item {
rightMargin: Theme.spacingS
verticalCenter: parent.verticalCenter
}
width: root.clockVisible ? (clockText.reservedWidth + Theme.spacingXS * 2) : 0
width: root.clockVisible ? (clockText.width + Theme.spacingXS * 2) : 0
height: root.clockPillHeight
visible: root.clockVisible
@@ -144,7 +144,7 @@ Item {
isMonospace: false
text: root.timeText
reserveText: root.timeText.replace(/\d/g, "0")
width: reservedWidth
width: Math.ceil(Math.max(implicitWidth, reservedWidth))
horizontalAlignment: Text.AlignHCenter
color: Theme.surfaceText
font.pixelSize: Theme.fontSizeSmall
-5
View File
@@ -69,7 +69,6 @@ Item {
id: fitMetrics
font.pixelSize: Math.max(1, root.baseTextSize)
font.weight: Font.Bold
text: root.numberText
}
@@ -77,7 +76,6 @@ Item {
id: digitInk
font.pixelSize: Math.max(1, root.textSize)
font.weight: Font.Bold
text: "0"
}
@@ -85,7 +83,6 @@ Item {
id: signMetrics
font.pixelSize: Math.max(1, root.baseTextSize * root.signRatio)
font.weight: Font.Bold
text: root.signText
}
@@ -147,7 +144,6 @@ Item {
text: root.numberText
color: glyphs.glyphColor
font.pixelSize: Math.max(1, root.textSize)
font.weight: Font.Bold
}
StyledText {
@@ -159,7 +155,6 @@ Item {
text: root.signText
color: glyphs.glyphColor
font.pixelSize: root.signSize
font.weight: Font.Bold
}
Bolt {