From cd1a69ec3e27a4b6c0df692ec5bdbc9b789c74b4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 10 Nov 2010 14:26:08 +1000 Subject: Flickable does not reposition its content when it is resized. Call fixup() after Flickable resize to ensure contents are within bounds. Task-number: QTBUG-15173 Reviewed-by: Bea Lam --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 01a8585..90cf9ed 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1029,6 +1029,13 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, d->contentItem->setWidth(width()); emit contentWidthChanged(); } + // Make sure that we're entirely in view. + if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; + d->fixupX(); + d->fixupDuration = oldDuration; + } } if (newGeometry.height() != oldGeometry.height()) { if (yflick()) @@ -1037,6 +1044,13 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, d->contentItem->setHeight(height()); emit contentHeightChanged(); } + // Make sure that we're entirely in view. + if (!d->pressed && !d->movingHorizontally && !d->movingVertically) { + int oldDuration = d->fixupDuration; + d->fixupDuration = 0; + d->fixupY(); + d->fixupDuration = oldDuration; + } } if (changed) -- cgit v0.12