]> git.lyx.org Git - features.git/commitdiff
Ignore horizontal wheel scrolling in workarea
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 20 Sep 2018 21:21:41 +0000 (23:21 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 21 Sep 2018 16:42:32 +0000 (18:42 +0200)
We do not know what to do with horizontal scrolling events, so we ignore them.

Note that the code has to be different between Qt4 and Qt5.

Fixes bug #11257.

(cherry picked from commit 2cfbc5ecf6e26da0ca3f61372e5373d1ef4f7ab7)

src/frontends/qt4/GuiWorkArea.cpp
status.23x

index 4adb155fa2573b2b49bd1d18b53b7ddc5d8daf95..f20ffe2d2c647b89c0f2f67551cf03888be875b7 100644 (file)
@@ -897,7 +897,23 @@ void GuiWorkArea::wheelEvent(QWheelEvent * ev)
 {
        // Wheel rotation by one notch results in a delta() of 120 (see
        // documentation of QWheelEvent)
+       // But first we have to ignore horizontal scroll events.
+#if QT_VERSION < 0x050000
+       if (ev->orientation() == Qt::Horizontal) {
+               ev->accept();
+               return;
+       }
        double const delta = ev->delta() / 120.0;
+#else
+       QPoint const aDelta = ev->angleDelta();
+       // skip horizontal wheel event
+       if (abs(aDelta.x()) > abs(aDelta.y())) {
+               ev->accept();
+               return;
+       }
+       double const delta = aDelta.y() / 120.0;
+#endif
+
        bool zoom = false;
        switch (lyxrc.scroll_wheel_zoom) {
        case LyXRC::SCROLL_WHEEL_ZOOM_CTRL:
index d70960c8a306e2e3bd2fed8224ebf1004b9d8d2f..65735fe2b6e98431295b487ff7606fe64d7e2bdf 100644 (file)
@@ -106,6 +106,8 @@ What's new
 
 - Fix conversion of captions from LyX 2.0 documents.
 
+- Ignore horizontal wheel scrolling in work area (bug 11257).
+
 
 
 * USER INTERFACE