From 1d924638199e40715e45facef851f89adf0e2820 Mon Sep 17 00:00:00 2001 From: Damocles Date: Mon, 27 Apr 2026 18:02:49 +0200 Subject: [PATCH] clock tooltip with seconds, cpu overall utilization chart, move mem graph below stats --- shell/applets/CpuApplet.qml | 45 ++++++++++++++++++++++++++++++++++ shell/applets/MemoryApplet.qml | 26 ++++++++++---------- shell/modules/ClockModule.qml | 2 +- 3 files changed, 59 insertions(+), 14 deletions(-) diff --git a/shell/applets/CpuApplet.qml b/shell/applets/CpuApplet.qml index 70e43d9..f1e75d2 100644 --- a/shell/applets/CpuApplet.qml +++ b/shell/applets/CpuApplet.qml @@ -138,6 +138,51 @@ Column { } } + // Overall CPU utilization chart + Item { + width: root.width + height: 44 + + Text { + id: _totalLabel + anchors.left: parent.left + anchors.leftMargin: 12 + anchors.verticalCenter: parent.verticalCenter + text: S.SystemStats.cpuUsage + "%" + color: S.Theme.loadColor(S.SystemStats.cpuUsage) + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily + font.bold: true + width: 32 + } + + SparklineCanvas { + anchors.left: _totalLabel.right + anchors.leftMargin: 6 + anchors.right: parent.right + anchors.rightMargin: 12 + anchors.verticalCenter: parent.verticalCenter + height: 32 + history: root._cpuHistory + strokeColor: root.accentColor + colorAt: v => S.Theme.loadColor(v) + active: root.active + } + } + + property var _cpuHistory: [] + onActiveChanged: if (active) + _cpuHistory = [] + Connections { + target: S.SystemStats + function onCpuUsageChanged() { + if (!root.active) + return; + const h = root._cpuHistory.concat([S.SystemStats.cpuUsage]); + root._cpuHistory = h.length > 60 ? h.slice(h.length - 60) : h; + } + } + Separator {} Item { diff --git a/shell/applets/MemoryApplet.qml b/shell/applets/MemoryApplet.qml index 065e686..b9b2f15 100644 --- a/shell/applets/MemoryApplet.qml +++ b/shell/applets/MemoryApplet.qml @@ -70,19 +70,6 @@ Column { } } - // Memory history sparkline - SparklineCanvas { - anchors.left: parent.left - anchors.leftMargin: 12 - anchors.right: parent.right - anchors.rightMargin: 12 - height: 32 - history: S.SystemStats.memHistory - strokeColor: root.accentColor - colorAt: v => S.Theme.loadColor(v) - active: root.active - } - // Breakdown rows InfoRow { label: "Used" @@ -101,6 +88,19 @@ Column { value: root._fmt(root.totalGb) } + // Memory history sparkline + SparklineCanvas { + anchors.left: parent.left + anchors.leftMargin: 12 + anchors.right: parent.right + anchors.rightMargin: 12 + height: 32 + history: S.SystemStats.memHistory + strokeColor: root.accentColor + colorAt: v => S.Theme.loadColor(v) + active: root.active + } + Separator {} Item { diff --git a/shell/modules/ClockModule.qml b/shell/modules/ClockModule.qml index 6250ae9..062eb12 100644 --- a/shell/modules/ClockModule.qml +++ b/shell/modules/ClockModule.qml @@ -8,7 +8,7 @@ M.BarModule { id: root active: S.Modules.clock.enable spacing: S.Theme.moduleSpacing - tooltip: Qt.formatDateTime(clock.date, "dddd, dd. MMMM yyyy") + tooltip: Qt.formatDateTime(clock.date, "dddd, dd. MMMM yyyy HH:mm:ss") panelNamespace: "nova-clock" panelContentWidth: 220 panelComponent: Component {