feat: graphs now properly sized + port static graphs to c++
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user