From 25c2ed1021e98184a5c29c8efd98f7e5ea9fd0e9 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 15 Apr 2026 02:27:09 +0200 Subject: [PATCH] perf: gate sparkline repaints on panel visibility --- modules/Cpu.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/Cpu.qml b/modules/Cpu.qml index 52c3420..db88749 100644 --- a/modules/Cpu.qml +++ b/modules/Cpu.qml @@ -202,8 +202,18 @@ M.BarSection { property var _hist: root._coreHistory[parent.parent.index] || [] property color _col: parent.parent._barColor - on_HistChanged: requestPaint() - on_ColChanged: requestPaint() + on_HistChanged: if (root._showPanel) + requestPaint() + on_ColChanged: if (root._showPanel) + requestPaint() + + Connections { + target: root + function on_ShowPanelChanged() { + if (root._showPanel) + sparkline.requestPaint(); + } + } onPaint: { const ctx = getContext("2d");