diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-09-09 01:37:49 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-09-09 01:37:49 (GMT) |
commit | a626641fafcf5f3a2e904cd0679f62ee70e19f4e (patch) | |
tree | 6f0f73bdfcebb2935baceea53047d41f6b32535d | |
parent | 80bd5e0206314155e8542520b4ec2fc5d9416e0e (diff) | |
download | Qt-a626641fafcf5f3a2e904cd0679f62ee70e19f4e.zip Qt-a626641fafcf5f3a2e904cd0679f62ee70e19f4e.tar.gz Qt-a626641fafcf5f3a2e904cd0679f62ee70e19f4e.tar.bz2 |
Positioners now implictly have the height and width of the childrenRect
Also removed the now uneccesary height and width bindings from the
twitter demo login screen.
-rw-r--r-- | demos/declarative/twitter/content/AuthView.qml | 8 | ||||
-rw-r--r-- | src/declarative/fx/qfxpositioners.cpp | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/demos/declarative/twitter/content/AuthView.qml b/demos/declarative/twitter/content/AuthView.qml index 7d0d865..febee94 100644 --- a/demos/declarative/twitter/content/AuthView.qml +++ b/demos/declarative/twitter/content/AuthView.qml @@ -5,10 +5,9 @@ import "../../flickr/mobile" Item { id: wrapper Column { - width: childrenRect.width; height:childrenRect.height; anchors.centerIn: parent + anchors.centerIn: parent spacing: 20 Row{ - width: childrenRect.width; height:childrenRect.height; spacing: 4 Text { width: 100 @@ -39,7 +38,6 @@ Item { } } Row{ - width: childrenRect.width; height:childrenRect.height; spacing: 4 Text { width: 100 @@ -65,8 +63,8 @@ Item { } } Item{ - width: childrenRect.width; anchors.horizontalCenter: parent.horizontalCenter - height: childrenRect.height + width: childrenRect.width; height:childrenRect.height; + anchors.horizontalCenter: parent.horizontalCenter Button { x: 10 width: 100 diff --git a/src/declarative/fx/qfxpositioners.cpp b/src/declarative/fx/qfxpositioners.cpp index bad4944..e4500aa 100644 --- a/src/declarative/fx/qfxpositioners.cpp +++ b/src/declarative/fx/qfxpositioners.cpp @@ -251,6 +251,18 @@ void QFxBasePositioner::prePositioning() d->_animated.clear(); doPositioning(); finishApplyTransitions(); + //Set implicit size to the size of its children + //###To keep this valid, do we need to update on pos change as well? + qreal h = 0.0f; + qreal w = 0.0f; + foreach(QFxItem *child, d->_items){ + if(!child->isVisible() || child->opacity() <= 0) + continue; + h = qMax(h, child->y() + child->height()); + w = qMax(w, child->x() + child->width()); + } + setImplicitHeight(h); + setImplicitWidth(w); } void QFxBasePositioner::applyTransition(const QList<QPair<QString, QVariant> >& changes, QFxItem* target, QmlStateOperation::ActionList &actions) |