Commit 122528d3 authored by Nate Graham's avatar Nate Graham
Browse files

Add option to disable smooth scrolling

Even though the animated smooth scrolling transitions are now affected
by the global animation speed setting in Plasma, this is not totally
satisfactory for the full pool of people who hate smooth scrolling, as
it does not address the cases of people using Okular outside of Plasma
or people who generally want animations but just not in Okular's
scrolling implementation.

Accordingly, there is now a GUI option to disable smooth scrolling in
Okular's settings window.

BUG: 420755
FIXED-IN: 20.12
parent ceb8cf62
Pipeline #35464 passed with stage
in 20 minutes and 9 seconds
......@@ -64,6 +64,13 @@
<property name="bottomMargin">
<widget class="QCheckBox" name="kcfg_SmoothScrolling">
<property name="text">
<string>Use smooth scrolling</string>
<widget class="QCheckBox" name="kcfg_ShowScrollBars">
<property name="text">
......@@ -286,6 +286,9 @@
<entry key="EditToolBarPlacement" type="Int" >
<entry key="SmoothScrolling" type="Bool" >
<entry key="ShowScrollBars" type="Bool" >
......@@ -2482,6 +2482,12 @@ Context menu actions like Rename Bookmarks etc.)
<sect1 id="configgeneral">
<term><guilabel>Use smooth scrolling</guilabel></term>
<para>Whether to display animated transitions when scrolling using the mouse wheel and keyboard.</para>
<term><guilabel>Show scrollbars</guilabel></term>
......@@ -451,7 +451,6 @@ PageView::PageView(QWidget *parent, Okular::Document *document)
// connect the padding of the viewport to pixmaps requests
connect(horizontalScrollBar(), &QAbstractSlider::valueChanged, this, &PageView::slotRequestVisiblePixmaps);
......@@ -871,6 +870,9 @@ void PageView::displayMessage(const QString &message, const QString &details, Pa
void PageView::reparseConfig()
// set smooth scrolling policies
// set the scroll bars policies
Qt::ScrollBarPolicy scrollBarMode = Okular::Settings::showScrollBars() ? Qt::ScrollBarAsNeeded : Qt::ScrollBarAlwaysOff;
if (horizontalScrollBarPolicy() != scrollBarMode) {
......@@ -4188,6 +4190,16 @@ void PageView::addSearchWithinDocumentAction(QMenu *menu, const QString &searchT
void PageView::updateSmoothScrollAnimationSpeed()
// If it's turned off in Okular's own settings, don't bother to look at the
// global settings
if (!Okular::Settings::smoothScrolling()) {
d->currentShortScrollDuration = 0;
d->currentLongScrollDuration = 0;
// If we are using smooth scrolling, scale the speed of the animated
// transitions according to the global animation speed setting
KConfigGroup kdeglobalsConfig = KConfigGroup(KSharedConfig::openConfig(), QStringLiteral("KDE"));
const qreal globalAnimationScale = qMax(0.0, kdeglobalsConfig.readEntry("AnimationDurationFactor", 1.0));
d->currentShortScrollDuration = d->baseShortScrollDuration * globalAnimationScale;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment