From caabd5e0ebc8ebcd68c71bb0aba072b134f58acb Mon Sep 17 00:00:00 2001 From: Bharadwaj Raju Date: Tue, 1 Feb 2022 21:34:48 +0000 Subject: [PATCH] kdecoration: Use proper easing curves for shadow animations Animating from invisible to visible should be OutCubic, and from visible to invisible should be InCubic. https://develop.kde.org/hig/style/animations (cherry picked from commit e5c6a3214d780cff22f524a0150be1c18ea978df) --- kdecoration/breezedecoration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp index c1a238d9..5e702fd6 100644 --- a/kdecoration/breezedecoration.cpp +++ b/kdecoration/breezedecoration.cpp @@ -222,7 +222,7 @@ namespace Breeze m_shadowAnimation->setStartValue( 0.0 ); m_shadowAnimation->setEndValue( 1.0 ); - m_shadowAnimation->setEasingCurve( QEasingCurve::InCubic ); + m_shadowAnimation->setEasingCurve( QEasingCurve::OutCubic ); connect(m_shadowAnimation, &QVariantAnimation::valueChanged, this, [this](const QVariant& value) { m_shadowOpacity = value.toReal(); updateShadow(); @@ -301,6 +301,7 @@ namespace Breeze const auto c = client().toStrongRef(); m_shadowAnimation->setDirection( c->isActive() ? QAbstractAnimation::Forward : QAbstractAnimation::Backward ); + m_shadowAnimation->setEasingCurve( c->isActive() ? QEasingCurve::OutCubic : QEasingCurve::InCubic ); if( m_shadowAnimation->state() != QAbstractAnimation::Running ) m_shadowAnimation->start(); } else {