]> git.lyx.org Git - lyx.git/commitdiff
QContentPane::mouseMoveEvent: Use qt wide scroll wheel setting
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 16 Mar 2006 15:26:44 +0000 (15:26 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 16 Mar 2006 15:26:44 +0000 (15:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13401 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/QContentPane.C

index 685dfc5079ceaea615600ea9a508d4c3bc9f4ef4..0aab79503fd90021db489f2f8e00a0f281ed8c66 100644 (file)
@@ -258,7 +258,11 @@ void QContentPane::mouseMoveEvent(QMouseEvent * e)
 
 void QContentPane::wheelEvent(QWheelEvent * e)
 {
-       wa_->scrollbar_->setValue(wa_->scrollbar_->value() - e->delta());
+       // Wheel rotation by one notch results in a delta() of 120 (see
+       // documentation of QWheelEvent)
+       int const lines = QApplication::wheelScrollLines() * e->delta() / 120;
+       wa_->scrollbar_->setValue(wa_->scrollbar_->value() -
+                                 lines *  wa_->scrollbar_->lineStep());
 }