[elvystrac] r1787 - page stepping improved on arrow key events

  • From: elvys@xxxxxxxxxxxxxxxxxxxxxx
  • To: elvystrac@xxxxxxxxxxxxx
  • Date: Thu, 18 Feb 2010 21:56:11 +0100

Author: JirkaH
Date: 2010-02-18 21:56:11 +0100 (Thu, 18 Feb 2010)
New Revision: 1787

Modified:
   trunk/client/elvys-client/src/pdfviewer.cpp
Log:
page stepping improved on arrow key events


Modified: trunk/client/elvys-client/src/pdfviewer.cpp
===================================================================
--- trunk/client/elvys-client/src/pdfviewer.cpp 2010-02-18 20:40:57 UTC (rev 
1786)
+++ trunk/client/elvys-client/src/pdfviewer.cpp 2010-02-18 20:56:11 UTC (rev 
1787)
@@ -223,20 +223,24 @@
                        
scroll->verticalScrollBar()->triggerAction(QScrollBar::SliderSingleStepSub);
                        break;
                case Qt::Key_Left:
-                       if ( scaled == 0 ) {
-                               scrollByOnePage(ElvysNs::Up);
-                       } else {
-                               
scroll->horizontalScrollBar()->triggerAction(QScrollBar::SliderSingleStepSub);
+                       if (scroll) {
+                               if ( ! 
scroll->horizontalScrollBar()->isVisible() ) {
+                                       scrollByOnePage(ElvysNs::Up);
+                               } else {
+                                       
scroll->horizontalScrollBar()->triggerAction(QScrollBar::SliderSingleStepSub);
+                               }
                        }
                        break;
                case Qt::Key_PageUp:
                        scrollByOnePage(ElvysNs::Up);
                        break;
                case Qt::Key_Right:
-                       if ( scaled == 0 ) {
-                               scrollByOnePage(ElvysNs::Down);
-                       } else {
-                               
scroll->horizontalScrollBar()->triggerAction(QScrollBar::SliderSingleStepAdd);
+                       if (scroll) {
+                               if ( ! 
scroll->horizontalScrollBar()->isVisible() ) {
+                                       scrollByOnePage(ElvysNs::Down);
+                               } else {
+                                       
scroll->horizontalScrollBar()->triggerAction(QScrollBar::SliderSingleStepAdd);
+                               }
                        }
                        break;
                case Qt::Key_PageDown:


Other related posts:

  • » [elvystrac] r1787 - page stepping improved on arrow key events - elvys