support horizontal scrollwheels

svn path=/trunk/KDE/kdelibs/; revision=1048147
This commit is contained in:
Marco Martin 2009-11-12 20:17:30 +00:00
parent fbd5f0411b
commit ae59a44b81

View File

@ -205,11 +205,13 @@ void KineticScrolling::wheelReleaseEvent(QGraphicsSceneWheelEvent *event)
int temp = -event->delta()/2; int temp = -event->delta()/2;
if ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Down)) || if (event->orientation() == Qt::Vertical &&
(event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Up))){ ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Down)) ||
(event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Up)))) {
d->kinMovement.setY(kinMovement().y() + temp); d->kinMovement.setY(kinMovement().y() + temp);
} else if (!d->canScroll(KineticScrollingPrivate::Down) && } else if (event->orientation() == Qt::Vertical ||
!d->canScroll(KineticScrollingPrivate::Up)) { (!d->canScroll(KineticScrollingPrivate::Down) &&
!d->canScroll(KineticScrollingPrivate::Up))) {
if ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Right)) || if ((event->delta() < 0 && d->canScroll(KineticScrollingPrivate::Right)) ||
(event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Left))) { (event->delta() > 0 && d->canScroll(KineticScrollingPrivate::Left))) {
d->kinMovement.setX(kinMovement().x() + temp); d->kinMovement.setX(kinMovement().x() + temp);