feat: graphs now properly sized + port static graphs to c++

This commit is contained in:
2026-11-08 01:28:27 +01:00
parent a7767d2a80
commit d69a6bcafd
17 changed files with 1592 additions and 1257 deletions
+16 -2
View File
@@ -19,7 +19,7 @@ void SparklineItem::geometryChange(
}
void SparklineItem::updateContentOffset() {
m_content->setX(-m_content->stepX() * m_slideProgress);
m_content->setSlideProgress(m_slideProgress);
}
void SparklineItem::applySmoothingRadius(
@@ -111,12 +111,26 @@ qreal SparklineItem::slideProgress() const {
}
void SparklineItem::setSlideProgress(qreal progress) {
if (qFuzzyCompare(m_slideProgress, progress)) return;
// Always forwarded: with a slide interval set the phase comes from the sample
// clock, so the offset can move even when the animation value repeats. An
// unchanged position is a no-op in QQuickItem.
m_slideProgress = progress;
updateContentOffset();
emit slideProgressChanged();
}
qreal SparklineItem::slideInterval() const {
return m_slideInterval;
}
void SparklineItem::setSlideInterval(qreal intervalMs) {
if (qFuzzyCompare(m_slideInterval, intervalMs)) return;
m_slideInterval = intervalMs;
m_content->setSlideInterval(intervalMs);
updateContentOffset();
emit slideIntervalChanged();
}
int SparklineItem::historyLength() const {
return m_historyLength;
}