From d97ba8a9c08bc931261766b1070bce610e7cb22e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 13 Mar 2026 02:14:52 +1100 Subject: fix: performance network usage jumping around --- modules/dashboard/Performance.qml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/dashboard/Performance.qml b/modules/dashboard/Performance.qml index 618d4e6..339c731 100644 --- a/modules/dashboard/Performance.qml +++ b/modules/dashboard/Performance.qml @@ -681,7 +681,7 @@ Item { SparklineItem { id: sparkline - property real targetMax: Math.max(NetworkUsage.downloadBuffer.maximum, NetworkUsage.uploadBuffer.maximum, 1024) + property real targetMax: 1024 property real smoothMax: targetMax anchors.fill: parent @@ -694,19 +694,23 @@ Item { maxValue: smoothMax historyLength: NetworkUsage.historyLength - Timer { - interval: Config.dashboard.resourceUpdateInterval - running: networkCard.visible - repeat: true - onTriggered: sparkline.targetMax = Math.max(NetworkUsage.downloadBuffer.maximum, NetworkUsage.uploadBuffer.maximum, 1024) + Connections { + target: NetworkUsage.downloadBuffer + + function onValuesChanged(): void { + sparkline.targetMax = Math.max(NetworkUsage.downloadBuffer.maximum, NetworkUsage.uploadBuffer.maximum, 1024); + slideAnim.restart(); + } } - NumberAnimation on slideProgress { + NumberAnimation { + id: slideAnim + + target: sparkline + property: "slideProgress" from: 0 to: 1 duration: Config.dashboard.resourceUpdateInterval - loops: Animation.Infinite - running: networkCard.visible } Behavior on smoothMax { -- cgit v1.2.3-freya