[Okular-devel] [Bug 148054] [HIG] SHIFT+SPACE doesn't scroll upwards

Pino Toscano toscano.pino at tiscali.it
Fri Jul 20 14:19:01 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=148054         
toscano.pino tiscali it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From toscano.pino tiscali it  2007-07-20 14:19 -------
SVN commit 690227 by pino:

Shift + Space is one screen back, says the HIG.

BUG: 148054


 M  +45 -38    pageview.cpp  


--- trunk/KDE/kdegraphics/okular/ui/pageview.cpp #690226:690227
 @ -1033,52 +1033,59  @
     // move/scroll page by using keys
     switch ( e->key() )
     {
+        case Qt::Key_Down:
+        case Qt::Key_PageDown:
+        case Qt::Key_Space:
         case Qt::Key_Up:
         case Qt::Key_PageUp:
         case Qt::Key_Backspace:
-            // if in single page mode and at the top of the screen, go to \ page
-            if ( Okular::Settings::viewContinuous() || verticalScrollBar()->value() > verticalScrollBar()->minimum() )
+            if ( e->key() == Qt::Key_Down
+                 || e->key() == Qt::Key_PageDown
+                 || ( e->key() == Qt::Key_Space && ( e->modifiers() & Qt::ShiftModifier ) != Qt::ShiftModifier ) )
             {
-                if ( e->key() == Qt::Key_Up )
-                    verticalScrollBar()->triggerAction( QScrollBar::SliderSingleStepSub );
-                else
-                    verticalScrollBar()->triggerAction( QScrollBar::SliderPageStepSub );
+                // 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 ( e->key() == Qt::Key_Down )
+                        verticalScrollBar()->triggerAction( QScrollBar::SliderSingleStepAdd );
+                    else
+                        verticalScrollBar()->triggerAction( QScrollBar::SliderPageStepAdd );
+                }
+                else if ( (int)d->document->currentPage() < d->items.count() - 1 )
+                {
+                   // more optimized than document->setNextPage and then move view to top
+                    Okular::DocumentViewport newViewport = d->document->viewport();
+                    newViewport.pageNumber += d->document->currentPage() ? viewColumns() : 1;
+                    if ( newViewport.pageNumber >= (int)d->items.count() )
+                        newViewport.pageNumber = d->items.count() - 1;
+                    newViewport.rePos.enabled = true;
+                    newViewport.rePos.normalizedY = 0.0;
+                    d->document->setViewport( newViewport );
+                }
             }
-            else if ( d->document->currentPage() > 0 )
+            else
             {
-                // more optimized than document->setPrevPage and then move view to bottom
-                Okular::DocumentViewport newViewport = d->document->viewport();
-                newViewport.pageNumber -= viewColumns();
-                if ( newViewport.pageNumber < 0 )
-                    newViewport.pageNumber = 0;
-                newViewport.rePos.enabled = true;
-                newViewport.rePos.normalizedY = 1.0;
-                d->document->setViewport( newViewport );
+                // if in single page mode and at the top of the screen, go to \ page
+                if ( Okular::Settings::viewContinuous() || verticalScrollBar()->value() > verticalScrollBar()->minimum() )
+                {
+                   if ( e->key() == Qt::Key_Up )
+                        verticalScrollBar()->triggerAction( QScrollBar::SliderSingleStepSub );
+                   else
+                       verticalScrollBar()->triggerAction( QScrollBar::SliderPageStepSub );
+                }
+                else if ( d->document->currentPage() > 0 )
+                {
+                    // more optimized than document->setPrevPage and then move view to bottom
+                    Okular::DocumentViewport newViewport = d->document->viewport();
+                    newViewport.pageNumber -= viewColumns();
+                    if ( newViewport.pageNumber < 0 )
+                        newViewport.pageNumber = 0;
+                    newViewport.rePos.enabled = true;
+                    newViewport.rePos.normalizedY = 1.0;
+                    d->document->setViewport( newViewport );
+                }
             }
             break;
-        case Qt::Key_Down:
-        case Qt::Key_PageDown:
-        case Qt::Key_Space:
-            // 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 ( e->key() == Qt::Key_Down )
-                    verticalScrollBar()->triggerAction( QScrollBar::SliderSingleStepAdd );
-                else
-                    verticalScrollBar()->triggerAction( QScrollBar::SliderPageStepAdd );
-            }
-            else if ( (int)d->document->currentPage() < d->items.count() - 1 )
-            {
-                // more optimized than document->setNextPage and then move view to top
-                Okular::DocumentViewport newViewport = d->document->viewport();
-                newViewport.pageNumber += d->document->currentPage() ? viewColumns() : 1;
-                if ( newViewport.pageNumber >= (int)d->items.count() )
-                    newViewport.pageNumber = d->items.count() - 1;
-                newViewport.rePos.enabled = true;
-                newViewport.rePos.normalizedY = 0.0;
-                d->document->setViewport( newViewport );
-            }
-            break;
         case Qt::Key_Left:
             horizontalScrollBar()->triggerAction( QScrollBar::SliderSingleStepSub );
             break;


More information about the Okular-devel mailing list