feat: graphs now properly sized + port static graphs to c++
This commit is contained in:
@@ -50,7 +50,6 @@ CustomRect {
|
||||
SparklineItem {
|
||||
id: sparkline
|
||||
|
||||
property bool initialized: false
|
||||
property real smoothMax: targetMax * 1.6
|
||||
property real targetMax: 1024
|
||||
|
||||
@@ -63,20 +62,15 @@ CustomRect {
|
||||
line2Color: Colors.palette.m3tertiary
|
||||
line2FillAlpha: 0.2
|
||||
maxValue: smoothMax
|
||||
slideInterval: Config.dashboard.resourceUpdateInterval
|
||||
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 * 1.6);
|
||||
|
||||
sparkline.initialized = true;
|
||||
}
|
||||
|
||||
Connections {
|
||||
@@ -94,6 +88,7 @@ CustomRect {
|
||||
duration: Config.dashboard.resourceUpdateInterval
|
||||
easing.type: Easing.Linear
|
||||
from: 0
|
||||
loops: Animation.Infinite
|
||||
property: "slideProgress"
|
||||
target: sparkline
|
||||
to: 1
|
||||
|
||||
Reference in New Issue
Block a user