| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ | |||
| 25 | 25 | #include <QTextStream> | |
| 26 | 26 | #include <QKeyEvent> | |
| 27 | 27 | #include <QMouseEvent> | |
| 28 | + #include <QPoint> | ||
| 28 | 29 | ||
| 29 | 30 | #include <QLineEdit> | |
| 30 | 31 | #include <QTextCodec> | |
@@ -2260,9 +2261,14 @@ void MergeResultWindow::slotCursorUpdate() | |||
| 2260 | 2261 | ||
| 2261 | 2262 | void MergeResultWindow::wheelEvent(QWheelEvent *e) | |
| 2262 | 2263 | { | |
| 2263 | - int d = -e->delta() * QApplication::wheelScrollLines() / 120; | ||
| 2264 | + QPoint d = e->pixelDelta(); | ||
| 2265 | + | ||
| 2266 | + if (d.isNull()) { | ||
| 2267 | + d = - e->angleDelta() / 120 * QApplication::wheelScrollLines(); | ||
| 2268 | + } | ||
| 2269 | + | ||
| 2264 | 2270 | e->accept(); | |
| 2265 | - scroll(0, min2(d, getNofVisibleLines())); | ||
| 2271 | + scroll(d.x(), min2(d.y(), getNofVisibleLines())); | ||
| 2266 | 2272 | } | |
| 2267 | 2273 | ||
| 2268 | 2274 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,7 @@ | |||
| 30 | 30 | #include <qcombobox.h> | |
| 31 | 31 | #include <QDropEvent> | |
| 32 | 32 | #include <QUrl> | |
| 33 | + #include <QPoint> | ||
| 33 | 34 | #include <QProcess> | |
| 34 | 35 | ||
| 35 | 36 | #include <assert.h> | |
@@ -783,12 +784,13 @@ bool KDiff3App::eventFilter(QObject *o, QEvent *e) | |||
| 783 | 784 | QWheelEvent *w = (QWheelEvent *)e; | |
| 784 | 785 | w->accept(); | |
| 785 | 786 | ||
| 786 | - int deltaX = 0; | ||
| 787 | + QPoint d = w->pixelDelta(); | ||
| 787 | 788 | ||
| 788 | - int d = w->delta(); | ||
| 789 | - int deltaY = -d / 120 * QApplication::wheelScrollLines(); | ||
| 789 | + if (d.isNull()) { | ||
| 790 | + d = - w->angleDelta() / 120 * QApplication::wheelScrollLines(); | ||
| 791 | + } | ||
| 790 | 792 | ||
| 791 | - scrollDiffTextWindow(deltaX, deltaY); | ||
| 793 | + scrollDiffTextWindow(d.x(), d.y()); | ||
| 792 | 794 | return true; | |
| 793 | 795 | } else if (e->type() == QEvent::Drop) { | |
| 794 | 796 | QDropEvent *pDropEvent = static_cast<QDropEvent *>(e); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments