Commit c69e8a5b authored by Nate Graham's avatar Nate Graham
Browse files

Merge branch 'release/20.08' into master

parents b5b3bd0c 17c26699
Pipeline #37535 passed with stage
in 26 minutes and 13 seconds
......@@ -353,10 +353,6 @@ void PartTest::testScrollBarAndMouseWheel()
// We should still be on the second page after that.
QTest::qWait(1000);
// This test for bug 421159 has been committed when there was no fix for the bug
// available yet. That's why the final QCOMPARE is preceded by QEXPECT_FAIL.
// Please remove the QEXPECT_FAIL together with the fix for bug 421159.
QEXPECT_FAIL("", "Please remove this QEXPECT_FAIL once bug 421159 is fixed!", Continue);
QCOMPARE(part.m_document->currentPage(), 1u);
}
......
......@@ -456,13 +456,16 @@ PageView::PageView(QWidget *parent, Okular::Document *document)
connect(horizontalScrollBar(), &QAbstractSlider::valueChanged, this, &PageView::slotRequestVisiblePixmaps);
connect(verticalScrollBar(), &QAbstractSlider::valueChanged, this, &PageView::slotRequestVisiblePixmaps);
// Keep the scroller in sync with user input on the scrollbars.
// QAbstractSlider::sliderMoved() and sliderReleased are the intuitive signals,
// but are only emitted when the “slider is down”, i. e. not when the user scrolls on the scrollbar.
// QAbstractSlider::actionTriggered() is emitted in all user input cases,
// but before the value() changes, so we need queued connection here.
auto update_scroller = [=]() {
d->scroller->scrollTo(QPoint(horizontalScrollBar()->value(), verticalScrollBar()->value()), 0); // sync scroller with scrollbar
};
connect(verticalScrollBar(), &QAbstractSlider::sliderReleased, this, update_scroller);
connect(horizontalScrollBar(), &QAbstractSlider::sliderReleased, this, update_scroller);
connect(verticalScrollBar(), &QAbstractSlider::sliderMoved, this, update_scroller);
connect(horizontalScrollBar(), &QAbstractSlider::sliderMoved, this, update_scroller);
connect(verticalScrollBar(), &QAbstractSlider::actionTriggered, this, update_scroller, Qt::QueuedConnection);
connect(horizontalScrollBar(), &QAbstractSlider::actionTriggered, this, update_scroller, Qt::QueuedConnection);
connect(&d->dragScrollTimer, &QTimer::timeout, this, &PageView::slotDragScroll);
......
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