relayout the icon when changing the text and the icon is not visible
this avoid "funny" sizes when the icon is shown svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=840300
This commit is contained in:
parent
4335bba59c
commit
ea546d6b61
@ -976,6 +976,10 @@ void Icon::setText(const QString& text)
|
||||
d->text = text;
|
||||
// cause a relayout
|
||||
d->currentSize = QSizeF(-1, -1);
|
||||
//try to relayout, needed if an icon was never shown before
|
||||
if (!isVisible()) {
|
||||
layoutIcons(new QStyleOptionGraphicsItem);
|
||||
}
|
||||
resize(sizeFromIconSize(d->iconSize.width()));
|
||||
}
|
||||
|
||||
@ -989,6 +993,10 @@ void Icon::setInfoText(const QString& text)
|
||||
d->infoText = text;
|
||||
// cause a relayout
|
||||
d->currentSize = QSizeF(-1, -1);
|
||||
//try to relayout, needed if an icon was never shown before
|
||||
if (!isVisible()) {
|
||||
layoutIcons(new QStyleOptionGraphicsItem);
|
||||
}
|
||||
resize(sizeFromIconSize(d->iconSize.width()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user