summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp18
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp5
3 files changed, 10 insertions, 19 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();
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index a3d585a..727dba3 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -746,12 +746,6 @@ void QDeclarativeGridViewPrivate::fixupPosition()
void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal maxExtent)
{
Q_Q(QDeclarativeGridView);
-
- if ((&data == &vData && !q->yflick())
- || (&data == &hData && !q->xflick())
- || data.move.timeLine())
- return;
-
int oldDuration = fixupDuration;
fixupDuration = moveReason == Mouse ? fixupDuration : 0;
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 80db730..5a0292f 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1101,11 +1101,6 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
|| (orient == QDeclarativeListView::Vertical && &data == &hData))
return;
- if ((&data == &vData && !q->yflick())
- || (&data == &hData && !q->xflick())
- || data.move.timeLine())
- return;
-
int oldDuration = fixupDuration;
fixupDuration = moveReason == Mouse ? fixupDuration : 0;