summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeflickable.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-19 01:38:47 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-19 01:38:47 (GMT)
commit4e9a4ff3f191094b27a5ab4ef56fcd078a0bc124 (patch)
tree33d055597641c70b596de6bddda0786472360392 /src/declarative/graphicsitems/qdeclarativeflickable.cpp
parent465f4df8ad4be9485c37ecc379c45e758b2842ad (diff)
downloadQt-4e9a4ff3f191094b27a5ab4ef56fcd078a0bc124.zip
Qt-4e9a4ff3f191094b27a5ab4ef56fcd078a0bc124.tar.gz
Qt-4e9a4ff3f191094b27a5ab4ef56fcd078a0bc124.tar.bz2
Always allow view position to be fixed.
We used to avoid doing fixup in a direction we were not flicking. This was pointless, and caused bugs when the view transitioned from flickable to not flickable, e.g. by content size change. Fixup following content size is also no longer animated. This can be acheived using a behavoir, for example. Task-number: QTBUG-9961
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeflickable.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 951b171..018d48f 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -248,18 +248,12 @@ void QDeclarativeFlickablePrivate::fixupX_callback(void *data)
void QDeclarativeFlickablePrivate::fixupX()
{
Q_Q(QDeclarativeFlickable);
- if (!q->xflick() || hData.move.timeLine())
- return;
-
fixup(hData, q->minXExtent(), q->maxXExtent());
}
void QDeclarativeFlickablePrivate::fixupY()
{
Q_Q(QDeclarativeFlickable);
- if (!q->yflick() || vData.move.timeLine())
- return;
-
fixup(vData, q->minYExtent(), q->maxYExtent());
}
@@ -1059,8 +1053,12 @@ void QDeclarativeFlickable::setContentWidth(qreal w)
else
d->viewport->setWidth(w);
// Make sure that we're entirely in view.
- if (!d->pressed)
+ if (!d->pressed) {
+ int oldDuration = d->fixupDuration;
+ d->fixupDuration = 0;
d->fixupX();
+ d->fixupDuration = oldDuration;
+ }
emit contentWidthChanged();
d->updateBeginningEnd();
}
@@ -1082,8 +1080,12 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
else
d->viewport->setHeight(h);
// Make sure that we're entirely in view.
- if (!d->pressed)
+ if (!d->pressed) {
+ int oldDuration = d->fixupDuration;
+ d->fixupDuration = 0;
d->fixupY();
+ d->fixupDuration = oldDuration;
+ }
emit contentHeightChanged();
d->updateBeginningEnd();
}