diff --git a/layouts/boxlayout.cpp b/layouts/boxlayout.cpp index d3779bef3..cd392b4e6 100644 --- a/layouts/boxlayout.cpp +++ b/layouts/boxlayout.cpp @@ -309,6 +309,7 @@ void BoxLayout::insertItem(int index, LayoutItem *item) } updateGeometry(); + startAnimation(); } void BoxLayout::addItem(LayoutItem *item) @@ -334,6 +335,7 @@ void BoxLayout::removeItem(LayoutItem *item) } updateGeometry(); + startAnimation(); } int BoxLayout::indexOf(LayoutItem *l) const @@ -357,6 +359,8 @@ LayoutItem *BoxLayout::takeAt(int i) } return d->children.takeAt(i); + // FIXME: This is never reached. Should it be called? Should + // startAnimation() also be called? updateGeometry(); } @@ -442,8 +446,6 @@ void BoxLayout::relayout() pos = d->layoutItem(margined, d->children[i], pos , sizes[i]); } - - startAnimation(); } diff --git a/layouts/flowlayout.cpp b/layouts/flowlayout.cpp index 5758934d6..a08c95d04 100644 --- a/layouts/flowlayout.cpp +++ b/layouts/flowlayout.cpp @@ -61,13 +61,15 @@ void FlowLayout::addItem(LayoutItem* item) return; } + item->setManagingLayout(this); d->items << item; if (animator()) { animator()->setCurrentState(item,LayoutAnimator::InsertedState); } - item->setManagingLayout(this); + updateGeometry(); + startAnimation(); } void FlowLayout::removeItem(LayoutItem* item) { @@ -81,6 +83,9 @@ void FlowLayout::removeItem(LayoutItem* item) if (animator()) { animator()->setCurrentState(item,LayoutAnimator::RemovedState); } + + updateGeometry(); + startAnimation(); } int FlowLayout::indexOf(LayoutItem* item) const { @@ -119,6 +124,7 @@ LayoutItem* FlowLayout::takeAt(int i) } return d->items.takeAt(i); + // FIXME: Should updateGeometry() and startAnimation() be called? } template @@ -215,8 +221,6 @@ void FlowLayout::relayout() else item->setGeometry( newGeometry ); } - - startAnimation(); } Qt::Orientations FlowLayout::expandingDirections() const