bar: make resource numbers have fixed width

This commit is contained in:
end-4
2025-08-12 22:09:20 +07:00
parent 4446259a0b
commit cb01563ba8
3 changed files with 18 additions and 7 deletions
+16 -4
View File
@@ -32,7 +32,7 @@ Item {
RowLayout {
id: resourceRowLayout
spacing: 4
spacing: 2
x: shown ? 0 : -resourceRowLayout.width
CircularProgress {
@@ -53,10 +53,22 @@ Item {
}
}
StyledText {
Item {
Layout.alignment: Qt.AlignVCenter
color: Appearance.colors.colOnLayer1
text: `${Math.round(percentage * 100)}`
implicitWidth: fullPercentageTextMetrics.width
implicitHeight: percentageText.implicitHeight
TextMetrics {
id: fullPercentageTextMetrics
text: "100"
}
StyledText {
id: percentageText
anchors.centerIn: parent
color: Appearance.colors.colOnLayer1
text: `${Math.round(percentage * 100).toString()}`
}
}
Behavior on x {