startAnimation() needs to be called if the layout geometry() changes as well
otherwise the updated layout doesn't take effect. This means that it really does need to be called from relayout(). So to prevent a quasi-infinite loop, don't restart the timeline if it's already running. This fixes the tasks geometry not updating correctly when applets are added to the panel. svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=754148
This commit is contained in:
parent
9cec9edf9c
commit
cb9747382b
@ -309,7 +309,6 @@ void BoxLayout::insertItem(int index, LayoutItem *item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
startAnimation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoxLayout::addItem(LayoutItem *item)
|
void BoxLayout::addItem(LayoutItem *item)
|
||||||
@ -335,7 +334,6 @@ void BoxLayout::removeItem(LayoutItem *item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
startAnimation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int BoxLayout::indexOf(LayoutItem *l) const
|
int BoxLayout::indexOf(LayoutItem *l) const
|
||||||
@ -359,8 +357,7 @@ LayoutItem *BoxLayout::takeAt(int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return d->children.takeAt(i);
|
return d->children.takeAt(i);
|
||||||
// FIXME: This is never reached. Should it be called? Should
|
// FIXME: This is never reached. Should it be called?
|
||||||
// startAnimation() also be called?
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,6 +443,8 @@ void BoxLayout::relayout()
|
|||||||
|
|
||||||
pos = d->layoutItem(margined, d->children[i], pos , sizes[i]);
|
pos = d->layoutItem(margined, d->children[i], pos , sizes[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ void FlowLayout::addItem(LayoutItem* item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
startAnimation();
|
|
||||||
}
|
}
|
||||||
void FlowLayout::removeItem(LayoutItem* item)
|
void FlowLayout::removeItem(LayoutItem* item)
|
||||||
{
|
{
|
||||||
@ -85,7 +84,6 @@ void FlowLayout::removeItem(LayoutItem* item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
startAnimation();
|
|
||||||
}
|
}
|
||||||
int FlowLayout::indexOf(LayoutItem* item) const
|
int FlowLayout::indexOf(LayoutItem* item) const
|
||||||
{
|
{
|
||||||
@ -124,7 +122,7 @@ LayoutItem* FlowLayout::takeAt(int i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return d->items.takeAt(i);
|
return d->items.takeAt(i);
|
||||||
// FIXME: Should updateGeometry() and startAnimation() be called?
|
// FIXME: Should updateGeometry() be called?
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -221,6 +219,8 @@ void FlowLayout::relayout()
|
|||||||
else
|
else
|
||||||
item->setGeometry( newGeometry );
|
item->setGeometry( newGeometry );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::Orientations FlowLayout::expandingDirections() const
|
Qt::Orientations FlowLayout::expandingDirections() const
|
||||||
|
@ -225,8 +225,8 @@ QSizeF Layout::maximumSize() const
|
|||||||
void Layout::startAnimation()
|
void Layout::startAnimation()
|
||||||
{
|
{
|
||||||
if (animator() && animator()->timeLine()) {
|
if (animator() && animator()->timeLine()) {
|
||||||
animator()->timeLine()->setCurrentTime(0);
|
|
||||||
if (animator()->timeLine()->state() == QTimeLine::NotRunning) {
|
if (animator()->timeLine()->state() == QTimeLine::NotRunning) {
|
||||||
|
animator()->timeLine()->setCurrentTime(0);
|
||||||
animator()->timeLine()->start();
|
animator()->timeLine()->start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user