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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user