Make the icon adjust its size when the text changes.

CCMAIL: panel-devel@kde.org
Please backport.


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=838892
This commit is contained in:
Alex Merry 2008-07-29 00:28:59 +00:00
parent 42018972e6
commit 5bda02b4c3

View File

@ -974,7 +974,10 @@ void Icon::setText(const QString& text)
{ {
d->text = text; d->text = text;
// cause a relayout // cause a relayout
// FIXME: is invalidating d->currentSize really necessary?
// FIXME: is d->currentSize really necessary at all?
d->currentSize = QSizeF(-1, -1); d->currentSize = QSizeF(-1, -1);
resize(sizeFromIconSize(d->iconSize.width()));
} }
QString Icon::text() const QString Icon::text() const
@ -986,7 +989,10 @@ void Icon::setInfoText(const QString& text)
{ {
d->infoText = text; d->infoText = text;
// cause a relayout // cause a relayout
// FIXME: is invalidating d->currentSize really necessary?
// FIXME: is d->currentSize really necessary at all?
d->currentSize = QSizeF(-1, -1); d->currentSize = QSizeF(-1, -1);
resize(sizeFromIconSize(d->iconSize.width()));
} }
QString Icon::infoText() const QString Icon::infoText() const