diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-03-13 02:14:52 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-03-13 02:14:52 +1100 |
| commit | d97ba8a9c08bc931261766b1070bce610e7cb22e (patch) | |
| tree | c09ed6a1e37255ce6d828308a732efc3bf895b76 /modules/dashboard/Performance.qml | |
| parent | feat: add excluded screens config opt (diff) | |
| download | caelestia-shell-d97ba8a9c08bc931261766b1070bce610e7cb22e.tar.gz caelestia-shell-d97ba8a9c08bc931261766b1070bce610e7cb22e.tar.bz2 caelestia-shell-d97ba8a9c08bc931261766b1070bce610e7cb22e.zip | |
fix: performance network usage jumping around
Diffstat (limited to 'modules/dashboard/Performance.qml')
| -rw-r--r-- | modules/dashboard/Performance.qml | 22 |
1 files 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 { |