perf: smooth UI animations and reduce repaint overhead

Batch of performance and animation work: shared FadeHelper/MotionPrefs
primitives, hover animators, shadow pixmap caching, smooth scrolling,
seek time bubble, and widespread component repaint reductions.
This commit is contained in:
dela
2026-07-08 11:29:38 +08:00
parent 03bc33518c
commit ab1accc821
85 changed files with 2308 additions and 661 deletions
+6 -1
View File
@@ -4,6 +4,7 @@
#include <services/media/mediaservice.h>
#include "../../managers/thememanager.h"
#include "../../utils/imageutils.h"
#include "../../utils/tweenedvalue.h"
#include <QFontMetrics>
#include <QHBoxLayout>
@@ -86,6 +87,10 @@ void NowPlayingCard::setupUi(const SessionInfo& session) {
m_progressBar->setRange(0, 1000);
infoLayout->addWidget(m_progressBar);
m_progressTween = new TweenedValue(this);
connect(m_progressTween, &TweenedValue::valueChanged, this,
[this](qreal value) { m_progressBar->setValue(qRound(value)); });
infoLayout->addSpacing(2);
@@ -151,7 +156,7 @@ void NowPlayingCard::updateSession(const SessionInfo& session) {
m_stateIcon->setPixmap(stateIcon.pixmap(QSize(12, 12)));
m_progressText->setText(posStr + " / " + durStr);
m_progressBar->setValue(static_cast<int>(session.playbackProgress() * 1000));
m_progressTween->setTarget(session.playbackProgress() * 1000);
m_progressText->show();
m_stateIcon->show();
m_progressBar->show();