Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit c4a84dad authored by Thomas Mitterfellner's avatar Thomas Mitterfellner Committed by Albert Astals Cid

Reduce hyper-sensitive touchpad scroll-zoom speed

BUG: 378584

Reduce hyper-sensitive touchpad scroll-zoom speed in Gwenview

Test Plan: Submitting this on behalf of  Thomas Mitterfellner since he's having trouble with his Phabricator access. Patch is  modeled after Albert's similar patch for Okular in Thomas has tested locally with a touchpad and scroll wheel, and I have tested in a KDE Neon VM. Seems to work as expected.

Reviewers: #kde_applications, broulik, aacid

Reviewed By: #kde_applications, aacid

Differential Revision:
parent a930fb54
......@@ -95,6 +95,7 @@ struct DocumentViewPrivate
bool mCurrent;
bool mCompareMode;
bool mEraseBorders;
int controlWheelAccumulatedDelta;
void setCurrentAdapter(AbstractDocumentViewAdapter* adapter)
......@@ -342,6 +343,7 @@ DocumentView::DocumentView(QGraphicsScene* scene)
d->mCurrent = false;
d->mCompareMode = false;
d->mEraseBorders = false;
d->controlWheelAccumulatedDelta = 0;
......@@ -573,11 +575,14 @@ qreal DocumentView::zoom() const
void DocumentView::wheelEvent(QGraphicsSceneWheelEvent* event)
if (d->mAdapter->canZoom() && event->modifiers() & Qt::ControlModifier) {
d->controlWheelAccumulatedDelta += event->delta();
// Ctrl + wheel => zoom in or out
if (event->delta() > 0) {
if (d->controlWheelAccumulatedDelta >= QWheelEvent::DefaultDeltasPerStep) {
} else {
d->controlWheelAccumulatedDelta = 0;
} else if (d->controlWheelAccumulatedDelta <= -QWheelEvent::DefaultDeltasPerStep) {
d->controlWheelAccumulatedDelta = 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment