From c568c1a2ea16e9990c7352991c9d02bfa72302b1 Mon Sep 17 00:00:00 2001 From: Mitchell Foral Date: Tue, 17 Jan 2023 15:33:09 +1100 Subject: Allow scrolling with mouse wheel when scroll bar hidden. --- qt/ScintillaEditBase/ScintillaEditBase.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'qt/ScintillaEditBase/ScintillaEditBase.cpp') 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); } } } -- cgit v1.2.3