]> git.lyx.org Git - features.git/commitdiff
* src/frontends/qt4/QWorkArea.C
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 16 Mar 2006 20:34:20 +0000 (20:34 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 16 Mar 2006 20:34:20 +0000 (20:34 +0000)
(QWorkArea::mouseMoveEvent): Use qt wide scroll wheel setting

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13409 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QWorkArea.C

index 3ccf2b4b7906661ccc771780505a6136230a7b5f..c438ca0ee5270b92d1e2beacfe1b61fb9e9150ba 100644 (file)
@@ -389,10 +389,15 @@ void QWorkArea::mouseMoveEvent(QMouseEvent * e)
 
 void QWorkArea::wheelEvent(QWheelEvent * e)
 {
-       verticalScrollBar()->setValue(verticalScrollBar()->value() - e->delta());
-       adjustViewWithScrollBar();\r
+       // Wheel rotation by one notch results in a delta() of 120 (see
+       // documentation of QWheelEvent)
+       int const lines = QApplication::wheelScrollLines() * e->delta() / 120;
+       verticalScrollBar()->setValue(verticalScrollBar()->value() -
+                       lines *  verticalScrollBar()->lineStep());
+       adjustViewWithScrollBar();
 }
 
+
 void QWorkArea::generateSyntheticMouseEvent()
 {
        // Set things off to generate the _next_ 'pseudo' event.