Commit 08d368c1 authored by Kezi Olio's avatar Kezi Olio Committed by Nate Graham

Fix scroll speed with free-spinning mouse wheels

BUG: 420492
FIXED-IN: 1.10.1

This just removes the smooth mouse wheel scrolling, fixing that problem.
parent 8fdfeeb6
......@@ -5365,17 +5365,14 @@ void PageView::slotAutoScrollDown()
void PageView::slotScrollUp( int nSteps )
{
//if we are too far behind the animation, do nothing and let it catch up
auto limit_value = nSteps ? 200 : verticalScrollBar()->rect().height();
if(d->scroller->state() == QScroller::Scrolling && abs(d->scroller->finalPosition().y() - verticalScrollBar()->value()) > limit_value){
if(d->scroller->state() == QScroller::Scrolling)
return;
}
// if in single page mode and at the top of the screen, go to \ page
if ( Okular::Settings::viewContinuous() || verticalScrollBar()->value() > verticalScrollBar()->minimum() )
{
if ( nSteps ){
d->scroller->scrollTo(d->scroller->finalPosition() + QPoint(0,-100*nSteps), 100);
d->scroller->scrollTo(d->scroller->finalPosition() + QPoint(0,-100*nSteps), 0);
}else{
if(d->scroller->finalPosition().y() > verticalScrollBar()->minimum())
d->scroller->scrollTo(d->scroller->finalPosition() + QPoint(0, -verticalScrollBar()->rect().height() ));
......@@ -5396,17 +5393,14 @@ void PageView::slotScrollUp( int nSteps )
void PageView::slotScrollDown( int nSteps )
{
//if we are too far behind the animation, do nothing and let it catch up
auto limit_value = nSteps ? 200 : verticalScrollBar()->rect().height();
if(d->scroller->state() == QScroller::Scrolling && abs(d->scroller->finalPosition().y() - verticalScrollBar()->value()) > limit_value){
if(d->scroller->state() == QScroller::Scrolling)
return;
}
// if in single page mode and at the bottom of the screen, go to next page
if ( Okular::Settings::viewContinuous() || verticalScrollBar()->value() < verticalScrollBar()->maximum() )
{
if ( nSteps ){
d->scroller->scrollTo(d->scroller->finalPosition() + QPoint(0,100*nSteps), 100);
d->scroller->scrollTo(d->scroller->finalPosition() + QPoint(0,100*nSteps), 0);
}else{
if(d->scroller->finalPosition().y() < verticalScrollBar()->maximum())
d->scroller->scrollTo(d->scroller->finalPosition() + QPoint(0, verticalScrollBar()->rect().height() ));
......
Markdown is supported
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