]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Increase smooth scrolling animation duration from 100 to 300 ms and set easing curve...
authorVishal Rao <vishalrao@gmail.com>
Sun, 26 Feb 2017 22:44:12 +0000 (23:44 +0100)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 26 Feb 2017 22:48:27 +0000 (23:48 +0100)
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

src/kitemviews/private/kitemlistsmoothscroller.cpp

index 6bfdba4c9ae5fbd911716e96c136685e7a5ee22e..cb1dd61ff4d4109561b29a0c4a073ca7a64bea9c 100644 (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);