diff options
-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) |