diff options
author | Mitchell Foral <unknown> | 2023-01-17 15:33:09 +1100 |
---|---|---|
committer | Mitchell Foral <unknown> | 2023-01-17 15:33:09 +1100 |
commit | c568c1a2ea16e9990c7352991c9d02bfa72302b1 (patch) | |
tree | db9e1b061ed801d98a7296cd87c6d0e328088071 | |
parent | abfef700976bbf3a2843b498f4216f63164d8661 (diff) | |
download | scintilla-mirror-c568c1a2ea16e9990c7352991c9d02bfa72302b1.tar.gz |
Allow scrolling with mouse wheel when scroll bar hidden.
-rw-r--r-- | doc/ScintillaHistory.html | 3 | ||||
-rw-r--r-- | qt/ScintillaEditBase/ScintillaEditBase.cpp | 14 |
2 files changed, 6 insertions, 11 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index b585396c9..01c9d44d6 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -600,6 +600,9 @@ On Qt, fix indicator drawing past left of text pane over margin. <a href="https://sourceforge.net/p/scintilla/bugs/2373/">Bug #2373</a>. </li> + <li> + On Qt, allow scrolling with mouse wheel when scroll bar hidden. + </li> </ul> <h3> <a href="https://www.scintilla.org/scintilla532.zip">Release 5.3.2</a> diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp index 79eafd634..b58a118aa 100644 --- a/qt/ScintillaEditBase/ScintillaEditBase.cpp +++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp @@ -169,10 +169,7 @@ int wheelEventYDelta(QWheelEvent *event) { void ScintillaEditBase::wheelEvent(QWheelEvent *event) { if (isWheelEventHorizontal(event)) { - if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) - event->ignore(); - else - QAbstractScrollArea::wheelEvent(event); + QAbstractScrollArea::wheelEvent(event); } else { if (QApplication::keyboardModifiers() & Qt::ControlModifier) { // Zoom! We play with the font sizes in the styles. @@ -183,13 +180,8 @@ void ScintillaEditBase::wheelEvent(QWheelEvent *event) sqt->KeyCommand(Message::ZoomOut); } } else { - // Ignore wheel events when the scroll bars are disabled. - if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) { - event->ignore(); - } else { - // Scroll - QAbstractScrollArea::wheelEvent(event); - } + // Scroll + QAbstractScrollArea::wheelEvent(event); } } } |