From db9e38d2673f2c3b9c3fdfad5bb20937217de0ca Mon Sep 17 00:00:00 2001 From: Damocles Date: Tue, 14 Apr 2026 01:00:54 +0200 Subject: [PATCH] cpu panel: add top processes list --- modules/Cpu.qml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/modules/Cpu.qml b/modules/Cpu.qml index 815f2cd..5ad2633 100644 --- a/modules/Cpu.qml +++ b/modules/Cpu.qml @@ -231,6 +231,49 @@ M.BarSection { } } + // Process list separator + Rectangle { + width: parent.width - 16 + height: 1 + anchors.horizontalCenter: parent.horizontalCenter + color: M.Theme.base03 + } + + // Top processes by CPU + Repeater { + model: M.ProcessList.byCpu + + delegate: Item { + required property var modelData + width: hoverPanel.contentWidth + height: 20 + + Text { + anchors.left: parent.left + anchors.leftMargin: 12 + anchors.verticalCenter: parent.verticalCenter + text: modelData.cmd + color: M.Theme.base05 + font.pixelSize: M.Theme.fontSize - 2 + font.family: M.Theme.fontFamily + elide: Text.ElideRight + width: parent.width - 80 + } + + Text { + anchors.right: parent.right + anchors.rightMargin: 12 + anchors.verticalCenter: parent.verticalCenter + text: modelData.cpu.toFixed(1) + "%" + color: root._loadColor(modelData.cpu) + font.pixelSize: M.Theme.fontSize - 2 + font.family: M.Theme.fontFamily + width: 36 + horizontalAlignment: Text.AlignRight + } + } + } + // Bottom padding Item { width: 1