KDE/kdebase/workspace/libs/plasma/widgets

Alex Merry huntedhacker at tiscali.co.uk
Tue Jul 29 02:29:00 CEST 2008


SVN commit 838892 by alexmerry:

Make the icon adjust its size when the text changes.

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



 M  +6 -0      icon.cpp  


--- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.cpp #838891:838892
@@ -974,7 +974,10 @@
 {
     d->text = text;
     // cause a relayout
+    // FIXME: is invalidating d->currentSize really necessary?
+    // FIXME: is d->currentSize really necessary at all?
     d->currentSize = QSizeF(-1, -1);
+    resize(sizeFromIconSize(d->iconSize.width()));
 }
 
 QString Icon::text() const
@@ -986,7 +989,10 @@
 {
     d->infoText = text;
     // cause a relayout
+    // FIXME: is invalidating d->currentSize really necessary?
+    // FIXME: is d->currentSize really necessary at all?
     d->currentSize = QSizeF(-1, -1);
+    resize(sizeFromIconSize(d->iconSize.width()));
 }
 
 QString Icon::infoText() const


More information about the Plasma-devel mailing list