improve formatting

This commit is contained in:
Benjamin Palko 2025-08-29 17:47:47 -04:00
parent c983cf206b
commit 69923dbfa3
2 changed files with 10 additions and 4 deletions

View file

@ -18,6 +18,9 @@ StyledButton {
contentItem: RowLayout { contentItem: RowLayout {
id: row id: row
spacing: 0
Ref { Ref {
service: SystemInfo service: SystemInfo
} }
@ -35,7 +38,7 @@ StyledButton {
id: text id: text
font.pixelSize: Dimensions.cpu.fontSize font.pixelSize: Dimensions.cpu.fontSize
text: ` ${(SystemInfo.cpuPerc * 100).toFixed()}%` text: ` ${(SystemInfo.cpuPerc * 100).toFixed().toString().padStart(2, "_")}%`
color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
states: [ states: [
@ -44,7 +47,7 @@ StyledButton {
when: root.showTemp when: root.showTemp
PropertyChanges { PropertyChanges {
text { text {
text: ` ${(SystemInfo.cpuTemp)}` text: `${(SystemInfo.cpuTemp)}`
} }
} }
} }

View file

@ -18,6 +18,9 @@ StyledButton {
contentItem: RowLayout { contentItem: RowLayout {
id: row id: row
spacing: 0
Ref { Ref {
service: SystemInfo service: SystemInfo
} }
@ -35,7 +38,7 @@ StyledButton {
id: text id: text
font.pixelSize: Dimensions.gpu.fontSize font.pixelSize: Dimensions.gpu.fontSize
text: ` ${(SystemInfo.gpuPerc * 100).toFixed()}%` text: ` ${(SystemInfo.gpuPerc * 100).toFixed().toString().padStart(2, "_")}%`
color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
states: [ states: [
@ -44,7 +47,7 @@ StyledButton {
when: root.showTemp when: root.showTemp
PropertyChanges { PropertyChanges {
text { text {
text: ` ${(SystemInfo.gpuTemp)}` text: `${(SystemInfo.gpuTemp)}`
} }
} }
} }