From ae59a44b81aedac647bd67d9672e368b4a637ae9 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 12 Nov 2009 20:17:30 +0000 Subject: [PATCH] support horizontal scrollwheels svn path=/trunk/KDE/kdelibs/; revision=1048147 --- private/kineticscroll.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/private/kineticscroll.cpp b/private/kineticscroll.cpp index af30ecf94..fb1151369 100644 --- a/private/kineticscroll.cpp +++ b/private/kineticscroll.cpp @@ -205,11 +205,13 @@ void KineticScrolling::wheelReleaseEvent(QGraphicsSceneWheelEvent *event) int temp = -event->delta()/2; - if ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Down)) || - (event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Up))){ + if (event->orientation() == Qt::Vertical && + ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Down)) || + (event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Up)))) { d->kinMovement.setY(kinMovement().y() + temp); - } else if (!d->canScroll(KineticScrollingPrivate::Down) && - !d->canScroll(KineticScrollingPrivate::Up)) { + } else if (event->orientation() == Qt::Vertical || + (!d->canScroll(KineticScrollingPrivate::Down) && + !d->canScroll(KineticScrollingPrivate::Up))) { if ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Right)) || (event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Left))) { d->kinMovement.setX(kinMovement().x() + temp);