scroll horizontally when the scroll is vertical and there was no space to scroll vertically
and vice versa for horizontal scroll svn path=/trunk/KDE/kdelibs/; revision=1106404
This commit is contained in:
parent
a0fe64f519
commit
07ad834e81
@ -644,7 +644,6 @@ public:
|
|||||||
|
|
||||||
QPointF start = widget.data()->pos();
|
QPointF start = widget.data()->pos();
|
||||||
QPointF end = start;
|
QPointF end = start;
|
||||||
qreal step = event->delta()/3;
|
|
||||||
|
|
||||||
//At some point we should switch to
|
//At some point we should switch to
|
||||||
// step = QApplication::wheelScrollLines() *
|
// step = QApplication::wheelScrollLines() *
|
||||||
@ -654,12 +653,26 @@ public:
|
|||||||
// is that at this point we don't have any clue what a "line" is and if
|
// is that at this point we don't have any clue what a "line" is and if
|
||||||
// we make it a pixel then scrolling by 3 (default) pixels will be
|
// we make it a pixel then scrolling by 3 (default) pixels will be
|
||||||
// very painful
|
// very painful
|
||||||
if(event->orientation() == Qt::Vertical) {
|
qreal step = event->delta()/3;
|
||||||
end += QPointF(0, step);
|
|
||||||
} else if (event->orientation() == Qt::Horizontal) {
|
//ifthe widget can scroll in a single axis and the wheel is the other one, scroll the other one
|
||||||
end += QPointF(step, 0);
|
Qt::Orientation orientation = event->orientation();
|
||||||
|
if (orientation == Qt::Vertical) {
|
||||||
|
if (!canYFlick() && canXFlick()) {
|
||||||
|
end += QPointF(step, 0);
|
||||||
|
} else if (canYFlick()) {
|
||||||
|
end += QPointF(0, step);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return;
|
if (canYFlick() && !canXFlick()) {
|
||||||
|
end += QPointF(0, step);
|
||||||
|
} else if (canXFlick()) {
|
||||||
|
end += QPointF(step, 0);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
directMoveAnimation->setStartValue(start);
|
directMoveAnimation->setStartValue(start);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user