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

This reverts commit 58c5eae195.

Reasons against this change:

1. Scroll is now too fast with devices such as touchpads or trackpoints.
2. Scroll behavior is now inconsistent between Dolphin and other applications
   (e.g. the Plasma file dialog). Breeze's default animation duration is 100 ms.
3. Many people complained and this feature is currently not configurable. We
   should introduce a QStyle::SH_Widget_Animation_Duration hint that would
   allow us to not hardcode durations in Dolphin (i.e. respect whatever
   duration the users set in their QStyle).
   Proposal in https://codereview.qt-project.org/#/c/195712/

Reviewers: #vdg, #plasma, emmanuelp, davidedmundson

Reviewed By: #plasma, davidedmundson

Differential Revision: https://phabricator.kde.org/D5883
This commit is contained in:
Elvis Angelaccio 2017-05-31 14:05:37 +02:00
parent 43da84eefc
commit 883b908b4b

View file

@ -35,9 +35,8 @@ 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) ? 300 : 1;
const int duration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar) ? 100 : 1;
m_animation->setDuration(duration);
m_animation->setEasingCurve(QEasingCurve::InOutQuart);
connect(m_animation, &QPropertyAnimation::stateChanged,
this, &KItemListSmoothScroller::slotAnimationStateChanged);