more layouting love;

* widgets should let Widget handle sizing, geometry unless there are very good reasons for it
* don't relayout the parent layout if the parent layout is already relayouting, because that relayout will have called the child's relayout in the first place. get it? relayout!
* i can dance. we can dance. do the relayout dance.
* some style guide fixes

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=738957
This commit is contained in:
Aaron J. Seigo 2007-11-20 01:19:59 +00:00
parent 396a48d6ce
commit 65d405f264
5 changed files with 5 additions and 13 deletions

View File

@ -305,7 +305,7 @@ void BoxLayout::insertItem(int index, LayoutItem *item)
d->children.insert(index, item);
if (animator()) {
animator()->setCurrentState(item,LayoutAnimator::InsertedState);
animator()->setCurrentState(item, LayoutAnimator::InsertedState);
}
updateGeometry();

View File

@ -129,6 +129,9 @@ void Layout::invalidate()
do {
parentLayout = dynamic_cast<Layout*>(layout->parent());
if (parentLayout) {
if (parentLayout->d->relayouting) {
break;
}
layout = parentLayout;
}
} while (parentLayout);

View File

@ -90,11 +90,6 @@ void Flash::setDuration( int duration )
d->defaultDuration = duration;
}
QSizeF Flash::sizeHint() const
{
return minimumSize();
}
void Flash::setColor( const QColor &color )
{
d->color = color;
@ -189,9 +184,5 @@ void Flash::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *optio
painter->drawPixmap(0, 0, Plasma::Phase::self()->animationResult(d->animId));
}
}
void Flash::setSize( const QSizeF & size )
{
Widget::setSize(size);
}
#include "flash.moc"

View File

@ -43,9 +43,6 @@ class PLASMA_EXPORT Flash : public Plasma::Widget
void paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
QRectF boundingRect() const;
virtual QSizeF sizeHint() const;
void setSize( const QSizeF & );
void setFont( const QFont & );
void setColor( const QColor & );

View File

@ -278,6 +278,7 @@ QRectF Widget::boundingRect() const
void Widget::resize(const QSizeF& size)
{
//FIXME: we need to respect minimum size here i think
setGeometry(QRectF(pos(), size));
}