From e3c166860437c8ae93963915284ad586d402c4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Sun, 1 Dec 2024 01:19:21 +0100 Subject: [PATCH] Graph: support Ctrl+Shift zoom Ref: #320 --- src/app/GUI/graphboxeslist.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/GUI/graphboxeslist.cpp b/src/app/GUI/graphboxeslist.cpp index c06b272ac..1f0bfe130 100644 --- a/src/app/GUI/graphboxeslist.cpp +++ b/src/app/GUI/graphboxeslist.cpp @@ -493,10 +493,13 @@ void KeysView::graphWheelEvent(QWheelEvent *event) #ifdef Q_OS_MAC if (event->angleDelta().y() == 0) { return; } #endif - if (event->modifiers() & Qt::ControlModifier) { + const bool ctrl = (event->modifiers() & Qt::ControlModifier); + const bool shift = (event->modifiers() & Qt::ShiftModifier); + if (ctrl && !shift) { emit wheelEventSignal(event); return; - } else if (event->modifiers() & Qt::ShiftModifier) { + } else if (ctrl || shift) { + if (ctrl) { emit wheelEventSignal(event); } qreal valUnderMouse; qreal frame; const auto ePos = event->position(); @@ -509,6 +512,7 @@ void KeysView::graphWheelEvent(QWheelEvent *event) (valUnderMouse - mMinShownVal)*graphScaleInc); mPixelsPerValUnit += graphScaleInc*mPixelsPerValUnit; graphUpdateDimensions(); + if (ctrl) { return; } } else { if (event->angleDelta().y() > 0) { graphIncMinShownVal(1); } else { graphIncMinShownVal(-1); }