|
|
|
|
@ -816,11 +816,12 @@ void PageView::displayMessage( const QString & message, const QString & details, |
|
|
|
|
void PageView::reparseConfig() |
|
|
|
|
{ |
|
|
|
|
// set the scroll bars policies
|
|
|
|
|
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); |
|
|
|
|
Qt::ScrollBarPolicy scrollBarMode = Okular::Settings::showScrollBars() ? |
|
|
|
|
Qt::ScrollBarAsNeeded : Qt::ScrollBarAlwaysOff; |
|
|
|
|
if ( horizontalScrollBarPolicy() != scrollBarMode ) |
|
|
|
|
{ |
|
|
|
|
setHorizontalScrollBarPolicy( scrollBarMode ); |
|
|
|
|
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); //setHorizontalScrollBarPolicy( scrollBarMode );
|
|
|
|
|
setVerticalScrollBarPolicy( scrollBarMode ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1910,7 +1911,7 @@ void PageView::keyPressEvent( QKeyEvent * e ) |
|
|
|
|
// move/scroll page by using keys
|
|
|
|
|
switch ( e->key() ) |
|
|
|
|
{ |
|
|
|
|
case Qt::Key_J: |
|
|
|
|
case Qt::Key_I: |
|
|
|
|
case Qt::Key_K: |
|
|
|
|
case Qt::Key_Down: |
|
|
|
|
case Qt::Key_PageDown: |
|
|
|
|
@ -1919,19 +1920,19 @@ void PageView::keyPressEvent( QKeyEvent * e ) |
|
|
|
|
case Qt::Key_Backspace: |
|
|
|
|
if ( e->key() == Qt::Key_Down |
|
|
|
|
|| e->key() == Qt::Key_PageDown |
|
|
|
|
|| e->key() == Qt::Key_J ) |
|
|
|
|
|| e->key() == Qt::Key_K ) |
|
|
|
|
{ |
|
|
|
|
bool singleStep = e->key() == Qt::Key_Down || e->key() == Qt::Key_J; |
|
|
|
|
bool singleStep = e->key() == Qt::Key_Down || e->key() == Qt::Key_K; |
|
|
|
|
slotScrollDown( singleStep ); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
bool singleStep = e->key() == Qt::Key_Up || e->key() == Qt::Key_K; |
|
|
|
|
bool singleStep = e->key() == Qt::Key_Up || e->key() == Qt::Key_I; |
|
|
|
|
slotScrollUp( singleStep ); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case Qt::Key_Left: |
|
|
|
|
case Qt::Key_H: |
|
|
|
|
case Qt::Key_J: |
|
|
|
|
if ( horizontalScrollBar()->maximum() == 0 ) |
|
|
|
|
{ |
|
|
|
|
//if we cannot scroll we go to the previous page vertically
|
|
|
|
|
@ -3299,17 +3300,11 @@ void PageView::wheelEvent( QWheelEvent *e ) |
|
|
|
|
vScroll = verticalScrollBar()->value(); |
|
|
|
|
e->accept(); |
|
|
|
|
if ( (e->modifiers() & Qt::ControlModifier) == Qt::ControlModifier ) { |
|
|
|
|
d->controlWheelAccumulatedDelta += delta; |
|
|
|
|
if ( d->controlWheelAccumulatedDelta <= -QWheelEvent::DefaultDeltasPerStep ) |
|
|
|
|
{ |
|
|
|
|
slotZoomOut(); |
|
|
|
|
d->controlWheelAccumulatedDelta = 0; |
|
|
|
|
} |
|
|
|
|
else if ( d->controlWheelAccumulatedDelta >= QWheelEvent::DefaultDeltasPerStep ) |
|
|
|
|
{ |
|
|
|
|
slotZoomIn(); |
|
|
|
|
d->controlWheelAccumulatedDelta = 0; |
|
|
|
|
} |
|
|
|
|
d->zoomFactor *= exp( (double)delta / 120.0 ); |
|
|
|
|
d->blockPixmapsRequest = true; |
|
|
|
|
updateZoom( ZoomRefreshCurrent ); |
|
|
|
|
d->blockPixmapsRequest = false; |
|
|
|
|
viewport()->repaint(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
@ -4936,7 +4931,7 @@ void PageView::slotAutoScroll() |
|
|
|
|
|
|
|
|
|
// compute delay between timer ticks and scroll amount per tick
|
|
|
|
|
int index = abs( d->scrollIncrement ) - 1; // 0..9
|
|
|
|
|
const int scrollDelay[10] = { 200, 100, 50, 30, 20, 30, 25, 20, 30, 20 }; |
|
|
|
|
const int scrollDelay[10] = { 100, 50, 25, 15, 10, 15, 12, 10, 15, 10 }; |
|
|
|
|
const int scrollOffset[10] = { 1, 1, 1, 1, 1, 2, 2, 2, 4, 4 }; |
|
|
|
|
d->autoScrollTimer->start( scrollDelay[ index ] ); |
|
|
|
|
int delta = d->scrollIncrement > 0 ? scrollOffset[ index ] : -scrollOffset[ index ]; |
|
|
|
|
|