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,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()
|
||||
|
||||
Reference in New Issue
Block a user