Bug 148054 - [HIG] SHIFT+SPACE doesn't scroll upwards
Summary: [HIG] SHIFT+SPACE doesn't scroll upwards
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-20 12:55 UTC by Florian Grässle
Modified: 2007-07-20 14:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Grässle 2007-07-20 12:55:49 UTC
Version:           current svn (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

Okular uses "Space" to scroll down one page/screen, but doesn't use "Shift + Space" to scroll up one page/screen. According to [1] and [2] this is a violation to both the old and new HIG. Please fix it to make okular consistent with other KDE applications. Thank you :)

[1] http://developer.kde.org/documentation/standards/kde/style/keys/shortcuts.html
[2] http://test.openusability.org/guidelines/index.php/Appendices:Keyboard_Shortcuts
Comment 1 Pino Toscano 2007-07-20 14:19:00 UTC
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;