Increase smooth scrolling animation duration from 100 to 300 ms and set easing curve to InOutQuart

Summary:
The current animation duration for smooth scrolling is 100 ms which feels as if there is no smooth scroll animation in the first place. Bumping this up to something like 300 ms seems to make the scrolling actually appear smooth.

Also, based on diff comments the easing curve is set to InOutQuart.

Test Plan: Built this change locally and tried scrolling a folder with many items both single step mouse wheel and also larger steps of the mouse wheel.

Reviewers: elvisangelaccio, emmanuelp

Reviewed By: emmanuelp

Subscribers: htietze, colomar, andreask, emmanuelp, elvisangelaccio

Differential Revision: https://phabricator.kde.org/D4560
This commit is contained in:
Vishal Rao 2017-02-26 23:44:12 +01:00 committed by Elvis Angelaccio
parent cc07b135d4
commit 58c5eae195

View file

@ -35,8 +35,9 @@ KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
m_animation(0)
{
m_animation = new QPropertyAnimation(this);
const int duration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar) ? 100 : 1;
const int duration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar) ? 300 : 1;
m_animation->setDuration(duration);
m_animation->setEasingCurve(QEasingCurve::InOutQuart);
connect(m_animation, &QPropertyAnimation::stateChanged,
this, &KItemListSmoothScroller::slotAnimationStateChanged);