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:
parent
396a48d6ce
commit
65d405f264
@ -129,6 +129,9 @@ void Layout::invalidate()
|
|||||||
do {
|
do {
|
||||||
parentLayout = dynamic_cast<Layout*>(layout->parent());
|
parentLayout = dynamic_cast<Layout*>(layout->parent());
|
||||||
if (parentLayout) {
|
if (parentLayout) {
|
||||||
|
if (parentLayout->d->relayouting) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
layout = parentLayout;
|
layout = parentLayout;
|
||||||
}
|
}
|
||||||
} while (parentLayout);
|
} while (parentLayout);
|
||||||
|
@ -90,11 +90,6 @@ void Flash::setDuration( int duration )
|
|||||||
d->defaultDuration = duration;
|
d->defaultDuration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF Flash::sizeHint() const
|
|
||||||
{
|
|
||||||
return minimumSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Flash::setColor( const QColor &color )
|
void Flash::setColor( const QColor &color )
|
||||||
{
|
{
|
||||||
d->color = 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));
|
painter->drawPixmap(0, 0, Plasma::Phase::self()->animationResult(d->animId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Flash::setSize( const QSizeF & size )
|
|
||||||
{
|
|
||||||
Widget::setSize(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "flash.moc"
|
#include "flash.moc"
|
||||||
|
@ -43,9 +43,6 @@ class PLASMA_EXPORT Flash : public Plasma::Widget
|
|||||||
|
|
||||||
void paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
void paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
virtual QSizeF sizeHint() const;
|
|
||||||
|
|
||||||
void setSize( const QSizeF & );
|
|
||||||
|
|
||||||
void setFont( const QFont & );
|
void setFont( const QFont & );
|
||||||
void setColor( const QColor & );
|
void setColor( const QColor & );
|
||||||
|
@ -278,6 +278,7 @@ QRectF Widget::boundingRect() const
|
|||||||
|
|
||||||
void Widget::resize(const QSizeF& size)
|
void Widget::resize(const QSizeF& size)
|
||||||
{
|
{
|
||||||
|
//FIXME: we need to respect minimum size here i think
|
||||||
setGeometry(QRectF(pos(), size));
|
setGeometry(QRectF(pos(), size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user