summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-08-31 03:19:13 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-08-31 03:19:13 (GMT)
commit291679bda83ff1abb9f0bd34740f16357f6e8285 (patch)
treec8834f243e06954900d70d37df6a934c31e14a6c
parent6e111b951930c892d86ae914706d16a11231a546 (diff)
parent25dffe6b5367518486edf8a91d5674be4852c50e (diff)
downloadQt-291679bda83ff1abb9f0bd34740f16357f6e8285.zip
Qt-291679bda83ff1abb9f0bd34740f16357f6e8285.tar.gz
Qt-291679bda83ff1abb9f0bd34740f16357f6e8285.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--src/declarative/util/qmlanimation.cpp4
-rw-r--r--src/declarative/util/qmlstateoperations.cpp32
-rw-r--r--src/declarative/util/qmlstateoperations.h1
3 files changed, 34 insertions, 3 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index 02b747f..d224388 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -1425,11 +1425,11 @@ void QmlParallelAnimation::transition(QmlStateActions &actions,
{
Q_D(QmlAnimationGroup);
- //needed for Behavior
+ //needed for Behavior
if (d->userProperty.isValid() && d->propertyName.isEmpty() && !target()) {
for (int i = 0; i < d->animations.count(); ++i)
d->animations.at(i)->setTarget(d->userProperty);
- }
+ }
for (int ii = 0; ii < d->animations.count(); ++ii) {
d->animations.at(ii)->transition(actions, modified, direction);
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index 85ad1b5..858a527 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -456,7 +456,6 @@ void QmlAnchorChanges::reverse()
d->target->anchors()->setTop(d->origTop);
if (d->origBottom.anchorLine != QFxAnchorLine::Invalid)
d->target->anchors()->setBottom(d->origBottom);
-
}
QString QmlAnchorChanges::typeName() const
@@ -520,6 +519,16 @@ void QmlAnchorChanges::clearForwardBindings()
d->target->anchors()->resetTop();
if (d->resetList.contains(QLatin1String("bottom")))
d->target->anchors()->resetBottom();
+
+ //reset any anchors that we'll be setting in the state
+ if (d->left.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetLeft();
+ if (d->right.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetRight();
+ if (d->top.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetTop();
+ if (d->bottom.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetBottom();
}
void QmlAnchorChanges::clearReverseBindings()
@@ -539,6 +548,27 @@ void QmlAnchorChanges::clearReverseBindings()
d->target->anchors()->resetTop();
if (d->bottom.anchorLine != QFxAnchorLine::Invalid)
d->target->anchors()->resetBottom();
+
+ //reset any anchors that were set in the original state
+ if (d->origLeft.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetLeft();
+ if (d->origRight.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetRight();
+ if (d->origTop.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetTop();
+ if (d->origBottom.anchorLine != QFxAnchorLine::Invalid)
+ d->target->anchors()->resetBottom();
+}
+
+bool QmlAnchorChanges::override(ActionEvent*other)
+{
+ if (other->typeName() != QLatin1String("AnchorChanges"))
+ return false;
+ if (static_cast<ActionEvent*>(this) == other)
+ return true;
+ //### can we do any other meaningful comparison? Do we need to attempt to merge the two
+ // somehow if they have the same target and some of the same anchors?
+ return false;
}
QT_END_NAMESPACE
diff --git a/src/declarative/util/qmlstateoperations.h b/src/declarative/util/qmlstateoperations.h
index 3018b44..afe0bd5 100644
--- a/src/declarative/util/qmlstateoperations.h
+++ b/src/declarative/util/qmlstateoperations.h
@@ -144,6 +144,7 @@ public:
virtual bool isReversable();
virtual void reverse();
virtual QString typeName() const;
+ virtual bool override(ActionEvent*other);
virtual QList<Action> extraActions();
virtual bool changesBindings();
virtual void clearForwardBindings();