summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-11-10 04:26:08 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-11-10 04:26:08 (GMT)
commitcd1a69ec3e27a4b6c0df692ec5bdbc9b789c74b4 (patch)
treef22d6562bd6508c4e42957c46cbe8abcfcf10953 /src/declarative/graphicsitems
parent9b24932eba2b204852c4f2b35e05bd7d9d47ccea (diff)
downloadQt-cd1a69ec3e27a4b6c0df692ec5bdbc9b789c74b4.zip
Qt-cd1a69ec3e27a4b6c0df692ec5bdbc9b789c74b4.tar.gz
Qt-cd1a69ec3e27a4b6c0df692ec5bdbc9b789c74b4.tar.bz2
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
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp14
1 files changed, 14 insertions, 0 deletions
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)