Fix applets jumping around when they resize. Avoid calling setGeometry() on Applets in a FreeLayout that have not changed their size hint since the last update.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=712674
This commit is contained in:
Robert Knight 2007-09-15 04:16:11 +00:00
parent 329d912f47
commit 7b607e92c9
2 changed files with 4 additions and 2 deletions

View File

@ -83,7 +83,9 @@ LayoutItem * FreeLayout::takeAt(int i)
void FreeLayout::setGeometry(const QRectF &geometry) void FreeLayout::setGeometry(const QRectF &geometry)
{ {
foreach (LayoutItem *child , d->children) { foreach (LayoutItem *child , d->children) {
child->setGeometry(QRectF(child->geometry().topLeft(),child->sizeHint())); if (child->geometry().size() != child->sizeHint()) {
child->setGeometry(QRectF(child->geometry().topLeft(),child->sizeHint()));
}
} }
d->geometry = geometry; d->geometry = geometry;
} }

View File

@ -217,7 +217,7 @@ void Widget::setGeometry(const QRectF& geometry)
} }
} }
setPos(geometry.topLeft() - boundingRect().topLeft()); setPos(geometry.topLeft());
update(); update();
} }