[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasma/widgets
From:       Marco Martin <notmart () gmail ! com>
Date:       2008-07-31 20:50:16
Message-ID: 1217537416.568598.8660.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 840300 by mart:

relayout the icon when changing the text and the icon is not visible
this avoid "funny" sizes when the icon is shown


 M  +8 -0      icon.cpp  


--- trunk/KDE/kdebase/workspace/libs/plasma/widgets/icon.cpp #840299:840300
@@ -976,6 +976,10 @@
     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 @@
     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()));
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic