fix: graph jitter on load + format

This commit is contained in:
2026-11-09 20:20:27 +01:00
parent d69a6bcafd
commit e49ecabf62
13 changed files with 181 additions and 320 deletions
+2 -27
View File
@@ -61,8 +61,8 @@ Item {
implicitHeight: mainLayout.implicitHeight + mainLayout.anchors.margins * 2
SnapLayout {
orientation: Qt.Vertical
id: mainLayout
orientation: Qt.Vertical
anchors.fill: parent
anchors.margins: Tokens.padding.large
spacing: 0
@@ -102,31 +102,6 @@ orientation: Qt.Vertical
line1FillAlpha: 0.15
maxValue: 1.0
slideInterval: Config.dashboard.resourceUpdateInterval
slideProgress: 1
Connections {
function onValuesChanged(): void {
slideAnim.restart();
}
target: card.buffer
}
NumberAnimation {
id: slideAnim
// Only drives frames; the slide phase is the sample
// clock inside SparklineItem. It must not stop at the
// end of a cycle, or the newest value is held on the
// clipped edge until the next sample arrives.
duration: Config.dashboard.resourceUpdateInterval
easing.type: Easing.Linear
from: 0
loops: Animation.Infinite
property: "slideProgress"
target: sparkline
to: 1
}
}
// "Collecting data" placeholder
@@ -139,8 +114,8 @@ orientation: Qt.Vertical
}
SnapLayout {
orientation: Qt.Vertical
id: infoColumn
orientation: Qt.Vertical
anchors.right: parent.right
anchors.bottom: parent.bottom
width: {
-14
View File
@@ -63,7 +63,6 @@ CustomRect {
line2FillAlpha: 0.2
maxValue: smoothMax
slideInterval: Config.dashboard.resourceUpdateInterval
slideProgress: 1
Behavior on smoothMax {
Anim {}
@@ -76,23 +75,10 @@ CustomRect {
Connections {
function onUpdateTriggered(): void {
sparkline.targetMax = Math.max(NetworkUsage.downloadBuffer.maximum, NetworkUsage.uploadBuffer.maximum, 1024);
slideAnim.restart();
}
target: NetworkUsage
}
NumberAnimation {
id: slideAnim
duration: Config.dashboard.resourceUpdateInterval
easing.type: Easing.Linear
from: 0
loops: Animation.Infinite
property: "slideProgress"
target: sparkline
to: 1
}
}
// "Collecting data" placeholder