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
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);