From: Alexandru Gagniuc Date: Sun, 16 Dec 2012 06:01:47 +0000 (-0600) Subject: Viewport: Allow horizontal scrolling via mouse wheel tilting X-Git-Tag: pulseview-0.1.0~189 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=238404062db14998f3b0ca93ae03a47543d219b8;p=pulseview.git Viewport: Allow horizontal scrolling via mouse wheel tilting On mice with a horizontal scroll wheel, or tilting wheel, enable the user to scroll horizontally. Signed-off-by: Alexandru Gagniuc --- diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index 2b03b767..90f2b4b2 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -119,6 +119,11 @@ void Viewport::wheelEvent(QWheelEvent *event) if (event->orientation() == Qt::Vertical) { // Vertical scrolling is interpreted as zooming in/out _view.zoom(event->delta() / 120, event->x()); + } else if (event->orientation() == Qt::Horizontal) { + // Horizontal scrolling is interpreted as moving left/right + _view.set_scale_offset(_view.scale(), + event->delta() * _view.scale() + + _view.offset()); } }