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

List:       kde-commits
Subject:    playground/utils/dolphin/src
From:       Peter Penz <peter.penz () gmx ! at>
Date:       2007-01-26 19:58:42
Message-ID: 1169841522.902754.16186.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 627494 by ppenz:

Further optimizations: do a delayed update of the geometry. This leads to a reduced \
flickering/resizing when e. g. the view is split or the window is resized.

 M  +8 -4      statusbarmessagelabel.cpp  
 M  +2 -0      statusbarmessagelabel.h  


--- trunk/playground/utils/dolphin/src/statusbarmessagelabel.cpp #627493:627494
@@ -79,7 +79,7 @@
         }
 
         m_pixmap = (iconName == 0) ? QPixmap() : SmallIcon(iconName);
-        assureVisibleText();
+        QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
         update();
     }
 }
@@ -93,7 +93,7 @@
             m_state = Illuminate;
         }
         m_text = text;
-        assureVisibleText();
+        QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
         update();
     }
 }
@@ -139,14 +139,18 @@
 
     // draw text
     painter.setPen(foregroundColor);
-    painter.drawText(QRect(x, 0, width() - x, height()), Qt::AlignVCenter | \
Qt::TextWordWrap, m_text); +    int flags = Qt::AlignVCenter;
+    if (height() > m_minTextHeight) {
+        flags = flags | Qt::TextWordWrap;
+    }
+    painter.drawText(QRect(x, 0, width() - x, height()), flags, m_text);
     painter.end();
 }
 
 void StatusBarMessageLabel::resizeEvent(QResizeEvent* event)
 {
     QWidget::resizeEvent(event);
-    QTimer::singleShot(0, this, SLOT(assureVisibleText()));
+    QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
 }
 
 void StatusBarMessageLabel::timerDone()
--- trunk/playground/utils/dolphin/src/statusbarmessagelabel.h #627493:627494
@@ -92,6 +92,8 @@
         Desaturate
     };
 
+    enum { GeometryTimeout = 100 };
+
     DolphinStatusBar::Type m_type;
     State m_state;
     int m_illumination;


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

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