diff --git a/NEWS.md b/NEWS.md index d9a8ca81..4ae894a0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ Red Panda C++ Version 2.21 - change: The option "Check for stack smashing attacks (-fstack-protector)" is turned off by default in the Debug compiler set settings. - fix: Project makefile generated for C files is not correct. + - fix: Horizontal scroll with touchpad is not working. Red Panda C++ Version 2.20 diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 1778adc0..2e5fb09a 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -6326,6 +6326,19 @@ void QSynEdit::wheelEvent(QWheelEvent *event) mWheelAccumulatedDeltaY+=120; verticalScrollBar()->setValue(verticalScrollBar()->value()+mMouseWheelScrollSpeed); } + + if ( (mWheelAccumulatedDeltaX>0 &&event->angleDelta().x()<0) + || (mWheelAccumulatedDeltaX<0 &&event->angleDelta().x()>0)) + mWheelAccumulatedDeltaX=0; + mWheelAccumulatedDeltaX+=event->angleDelta().x(); + while (mWheelAccumulatedDeltaX>=120) { + mWheelAccumulatedDeltaX-=120; + horizontalScrollBar()->setValue(horizontalScrollBar()->value()-mMouseWheelScrollSpeed); + } + while (mWheelAccumulatedDeltaX<=-120) { + mWheelAccumulatedDeltaX+=120; + horizontalScrollBar()->setValue(horizontalScrollBar()->value()+mMouseWheelScrollSpeed); + } } event->accept(); }