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
+5 -2
View File
@@ -1,4 +1,6 @@
#include "playerosdlayer.h"
#include "../tokens/AnimationTokens.h"
#include "../utils/motionprefs.h"
#include <QAbstractAnimation>
#include <QGraphicsOpacityEffect>
#include <QIcon>
@@ -56,7 +58,8 @@ PlayerOsdLayer::PlayerOsdLayer(QWidget *parent)
m_fadeAnim = new QPropertyAnimation(m_opacity, "opacity", this);
m_fadeAnim->setDuration(250);
m_fadeAnim->setDuration(AnimationTokens::DurationMs::kNormal);
m_fadeAnim->setEasingCurve(AnimationTokens::Curve::fade());
m_hideTimer = new QTimer(this);
@@ -276,7 +279,7 @@ void PlayerOsdLayer::fadeIn()
bool PlayerOsdLayer::canStartAnimation() const
{
return m_fadeAnim && m_fadeAnim->targetObject();
return m_fadeAnim && m_fadeAnim->targetObject() && !MotionPrefs::reduceMotion();
}
void PlayerOsdLayer::updateSeekLayout()