cpu/mem panels: drop floating header values, add total row to memory breakdown

This commit is contained in:
Damocles 2026-04-17 11:45:35 +02:00
parent 736a8126e4
commit 69dff5a263
2 changed files with 25 additions and 82 deletions

View file

@ -7,24 +7,6 @@ M.BarSection {
spacing: Math.max(1, M.Theme.moduleSpacing - 2) spacing: Math.max(1, M.Theme.moduleSpacing - 2)
tooltip: "" tooltip: ""
property int usage: M.SystemStats.cpuUsage
Behavior on usage {
enabled: root._showPanel
NumberAnimation {
duration: 400
easing.type: Easing.OutCubic
}
}
property real freqGhz: M.SystemStats.cpuFreqGhz
Behavior on freqGhz {
enabled: root._showPanel
NumberAnimation {
duration: 400
easing.type: Easing.OutCubic
}
}
readonly property var _cores: M.SystemStats.cpuCores readonly property var _cores: M.SystemStats.cpuCores
readonly property var _coreMaxFreq: M.SystemStats.cpuCoreMaxFreq readonly property var _coreMaxFreq: M.SystemStats.cpuCoreMaxFreq
readonly property var _coreTypes: M.SystemStats.cpuCoreTypes readonly property var _coreTypes: M.SystemStats.cpuCoreTypes
@ -100,53 +82,6 @@ M.BarSection {
panelTitle: "CPU" panelTitle: "CPU"
contentWidth: 260 contentWidth: 260
// Header freq + usage (title comes from panelTitle)
Item {
width: parent.width
height: 28
Text {
id: _headerFreq
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: root.freqGhz.toFixed(2) + " GHz"
color: root.accentColor
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
font.bold: true
width: _headerFreqSizer.implicitWidth
horizontalAlignment: Text.AlignRight
Text {
id: _headerFreqSizer
visible: false
text: "9.99 GHz"
font: parent.font
}
}
Text {
anchors.right: _headerFreq.left
anchors.rightMargin: 6
anchors.verticalCenter: parent.verticalCenter
text: root.usage + "%"
color: root.accentColor
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
font.bold: true
width: _headerUsageSizer.implicitWidth
horizontalAlignment: Text.AlignRight
Text {
id: _headerUsageSizer
visible: false
text: "100%"
font: parent.font
}
}
}
// Per-core rows // Per-core rows
Repeater { Repeater {
model: root._cores.length model: root._cores.length

View file

@ -69,23 +69,6 @@ M.BarSection {
panelTitle: "Memory" panelTitle: "Memory"
contentWidth: 240 contentWidth: 240
// Header used/total (title comes from panelTitle)
Item {
width: parent.width
height: 28
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: root._fmt(root.usedGb) + " / " + root._fmt(root.totalGb)
color: root.accentColor
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
font.bold: true
}
}
// Usage bar // Usage bar
Item { Item {
width: parent.width width: parent.width
@ -257,6 +240,31 @@ M.BarSection {
} }
} }
Item {
width: parent.width
height: 18
Text {
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: "Total"
color: M.Theme.base04
font.pixelSize: M.Theme.fontSize - 2
font.family: M.Theme.fontFamily
}
Text {
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: root._fmt(root.totalGb)
color: M.Theme.base05
font.pixelSize: M.Theme.fontSize - 2
font.family: M.Theme.fontFamily
}
}
// Process list separator // Process list separator
Rectangle { Rectangle {
width: parent.width - 16 width: parent.width - 16