fix(bar): Ensure SystemMonitor temperature is fully visible

In the vertical bar layout, the temperature text in the SystemMonitor
widget (e.g., "55°C") could be truncated due to the widget's fixed
width.
  This commit resolves the issue by applying a dynamic scale
transformation to the text component.
This commit is contained in:
loner
2025-09-22 11:26:21 +08:00
parent f348eb993c
commit 355473a946
+2 -1
View File
@@ -120,7 +120,7 @@ Rectangle {
columnSpacing: Style.marginXXS * scaling
NText {
text: isVertical ? `${SystemStatService.cpuTemp}°` : `${SystemStatService.cpuTemp}°C`
text: `${SystemStatService.cpuTemp}°C`
font.family: Settings.data.ui.fontFixed
font.pointSize: textSize
font.weight: Style.fontWeightMedium
@@ -128,6 +128,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: Color.mPrimary
scale: isVertical ? Math.min(1.0, cpuTempContent.width / implicitWidth) : 1.0
Layout.row: isVertical ? 0 : 0
Layout.column: isVertical ? 0 : 1
}