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
+9 -8
View File
@@ -1,4 +1,5 @@
#include "mainwindow.h"
#include "tokens/AnimationTokens.h"
#include <qembycore.h>
#include "views/public/loginview.h"
#include "views/media/playerview.h"
@@ -566,11 +567,11 @@ MainWindow::MainWindow(QWidget *parent)
auto anim = new QPropertyAnimation(transition, "radius", transition);
anim->setDuration(450);
anim->setDuration(AnimationTokens::DurationMs::kSlow);
anim->setStartValue(0);
anim->setEndValue(maxRadius);
anim->setEasingCurve(QEasingCurve::InOutCubic);
anim->setEasingCurve(AnimationTokens::Curve::enter());
connect(anim, &QPropertyAnimation::finished, transition, &QObject::deleteLater);
@@ -662,10 +663,10 @@ MainWindow::MainWindow(QWidget *parent)
auto anim = new QPropertyAnimation(transition, "radius", transition);
anim->setDuration(450);
anim->setDuration(AnimationTokens::DurationMs::kSlow);
anim->setStartValue(0);
anim->setEndValue(maxRadius);
anim->setEasingCurve(QEasingCurve::InOutCubic);
anim->setEasingCurve(AnimationTokens::Curve::enter());
connect(anim, &QPropertyAnimation::finished, transition, &QObject::deleteLater);
anim->start(QAbstractAnimation::DeleteWhenStopped);
} else {
@@ -957,10 +958,10 @@ void MainWindow::navigateToHome()
m_viewStack->setCurrentWidget(m_homeView);
auto *fadeIn = new QPropertyAnimation(homeOpacity, "opacity", this);
fadeIn->setDuration(250);
fadeIn->setDuration(AnimationTokens::DurationMs::kNormal);
fadeIn->setStartValue(0.0);
fadeIn->setEndValue(1.0);
fadeIn->setEasingCurve(QEasingCurve::OutQuad);
fadeIn->setEasingCurve(AnimationTokens::Curve::fade());
connect(fadeIn, &QPropertyAnimation::finished, this, [this]() {
m_homeView->setGraphicsEffect(nullptr);
@@ -1017,10 +1018,10 @@ void MainWindow::navigateToLogin() {
m_viewStack->setCurrentWidget(m_loginView);
auto *fadeIn = new QPropertyAnimation(loginOpacity, "opacity", this);
fadeIn->setDuration(250);
fadeIn->setDuration(AnimationTokens::DurationMs::kNormal);
fadeIn->setStartValue(0.0);
fadeIn->setEndValue(1.0);
fadeIn->setEasingCurve(QEasingCurve::OutQuad);
fadeIn->setEasingCurve(AnimationTokens::Curve::fade());
connect(fadeIn, &QPropertyAnimation::finished, this, [this]() {
m_loginView->setGraphicsEffect(nullptr);