rounded sparkline graph, fixed network usage accumulation spikes
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 9s
Python / lint-format (pull_request) Successful in 19s
Python / test (pull_request) Successful in 29s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m6s

This commit is contained in:
2026-06-16 13:52:43 +02:00
parent ea82b8cf22
commit c0b62dfb6c
5 changed files with 76 additions and 11 deletions
+15
View File
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import ZShell.Internal
import qs.Modules.Resources
import qs.Helpers
import qs.Components
import qs.Config
@@ -8,6 +9,8 @@ import qs.Config
CustomRect {
id: root
required property Wrapper wrapper
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: 220
implicitWidth: 300
@@ -47,6 +50,7 @@ CustomRect {
SparklineItem {
id: sparkline
property bool initialized: false
property real smoothMax: targetMax
property real targetMax: 1024
@@ -59,12 +63,23 @@ CustomRect {
line2Color: DynamicColors.palette.m3tertiary
line2FillAlpha: 0.2
maxValue: smoothMax
slideProgress: 1
Behavior on smoothMax {
enabled: sparkline.initialized
Anim {
}
}
Component.onCompleted: {
sparkline.targetMax = Math.max(NetworkUsage.downloadBuffer.maximum, NetworkUsage.uploadBuffer.maximum, 1024);
sparkline.smoothMax = Qt.binding(() => sparkline.targetMax);
sparkline.initialized = true;
}
Connections {
function onValuesChanged(): void {
sparkline.targetMax = Math.max(NetworkUsage.downloadBuffer.maximum, NetworkUsage.uploadBuffer.maximum, 1024);
+3
View File
@@ -9,6 +9,8 @@ import qs.Config
Item {
id: root
required property Wrapper wrapper
implicitHeight: content.implicitHeight + Appearance.padding.normal * 2
implicitWidth: content.implicitWidth
@@ -98,6 +100,7 @@ Item {
active: Config.dashboard.performance.showNetwork
sourceComponent: NetworkCard {
wrapper: root.wrapper
}
}
}
+1
View File
@@ -34,6 +34,7 @@ Item {
anchors.centerIn: parent
sourceComponent: Content {
wrapper: root
}
}
}