fix: performance cpu/gpu name overlapping usage

Fixes #1337
This commit is contained in:
2 * r + 2 * t 2026-03-30 01:41:26 +11:00
parent 5c59e4490a
commit 1f3656c2f6

View file

@ -358,67 +358,60 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: parent.width * heroCard.animatedUsage implicitWidth: parent.width * heroCard.animatedUsage
color: Qt.alpha(heroCard.accentColor, 0.15) color: Qt.alpha(heroCard.accentColor, 0.15)
} }
ColumnLayout { CardHeader {
anchors.fill: parent anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: Appearance.padding.large anchors.leftMargin: Appearance.padding.large
anchors.rightMargin: Appearance.padding.large anchors.topMargin: Math.round(Appearance.padding.large * 1.2)
anchors.topMargin: Appearance.padding.normal
anchors.bottomMargin: Appearance.padding.normal width: parent.width - anchors.leftMargin - usageColumn.anchors.rightMargin - usageLabel.width - Appearance.spacing.normal
icon: heroCard.icon
title: heroCard.title
accentColor: heroCard.accentColor
}
Column {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: Math.round(Appearance.padding.large * 1.2)
anchors.bottomMargin: Math.round(Appearance.padding.large * 1.3)
spacing: Appearance.spacing.small spacing: Appearance.spacing.small
CardHeader { Row {
icon: heroCard.icon spacing: Appearance.spacing.small
title: heroCard.title
accentColor: heroCard.accentColor StyledText {
text: heroCard.secondaryValue
font.pointSize: Appearance.font.size.normal
font.weight: Font.Medium
}
StyledText {
text: heroCard.secondaryLabel
font.pointSize: Appearance.font.size.small
color: Colours.palette.m3onSurfaceVariant
anchors.baseline: parent.children[0].baseline
}
} }
RowLayout { ProgressBar {
Layout.fillWidth: true implicitWidth: parent.width * 0.5
Layout.fillHeight: true implicitHeight: 6
spacing: Appearance.spacing.normal value: heroCard.tempProgress
fgColor: heroCard.accentColor
Column { bgColor: Qt.alpha(heroCard.accentColor, 0.2)
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
spacing: Appearance.spacing.small
Row {
spacing: Appearance.spacing.small
StyledText {
text: heroCard.secondaryValue
font.pointSize: Appearance.font.size.normal
font.weight: Font.Medium
}
StyledText {
text: heroCard.secondaryLabel
font.pointSize: Appearance.font.size.small
color: Colours.palette.m3onSurfaceVariant
anchors.baseline: parent.children[0].baseline
}
}
ProgressBar {
width: parent.width * 0.5
height: 6
value: heroCard.tempProgress
fgColor: heroCard.accentColor
bgColor: Qt.alpha(heroCard.accentColor, 0.2)
}
}
Item {
Layout.fillWidth: true
}
} }
} }
Column { Column {
id: usageColumn
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.margins: Appearance.padding.large anchors.margins: Appearance.padding.large
@ -426,6 +419,8 @@ Item {
spacing: 0 spacing: 0
StyledText { StyledText {
id: usageLabel
anchors.right: parent.right anchors.right: parent.right
text: heroCard.mainLabel text: heroCard.mainLabel
font.pointSize: Appearance.font.size.normal font.pointSize: Appearance.font.size.normal