Scale smooth scroll durations according to the global animation speed

Now people who don't like animations can set thenm to "Instant" globally
and smooth scrolling will be effectively disabled off in Okular.

There is no change in speed for people using the default global
animation duration.

BUG: 420755
FIXED-IN: 1.12.0
remotes/origin/work/aacid/shorcutslost_2008
Nate Graham 6 years ago
parent 37bb01c61d
commit 2d6fafe255
  1. 7
      ui/pageview.cpp

@ -439,6 +439,13 @@ PageView::PageView(QWidget *parent, Okular::Document *document)
horizontalScrollBar()->setCursor(Qt::ArrowCursor);
horizontalScrollBar()->setSingleStep(20);
// make the smooth scroll animation durations respect the global animation
// scale
KConfigGroup kdeglobalsConfig = KConfigGroup(KSharedConfig::openConfig(), QStringLiteral("KDE"));
const qreal globalAnimationScale = qMax(0.0, kdeglobalsConfig.readEntry("AnimationDurationFactor", 1.0));
d->smoothScrollShortDuration *= globalAnimationScale;
d->smoothScrollLongDuration *= globalAnimationScale;
// connect the padding of the viewport to pixmaps requests
connect(horizontalScrollBar(), &QAbstractSlider::valueChanged, this, &PageView::slotRequestVisiblePixmaps);
connect(verticalScrollBar(), &QAbstractSlider::valueChanged, this, &PageView::slotRequestVisiblePixmaps);

Loading…
Cancel
Save