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 e5c6a3214d)
wilder-5.24
Bharadwaj Raju 4 years ago committed by Nate Graham
parent 9f7210554d
commit caabd5e0eb
  1. 3
      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 {

Loading…
Cancel
Save