]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Backport: Only increase the height of the statusbar for long texts if the message...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 9 Jan 2008 21:52:38 +0000 (21:52 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 9 Jan 2008 21:52:38 +0000 (21:52 +0000)
svn path=/branches/KDE/4.0/kdebase/apps/; revision=759061

src/statusbarmessagelabel.cpp

index 7bc9f8fbdaff41ed5eb9de9ca12753cab67f447b..e24a59add4949a0cfc57e9cc34f12f6e5709507f 100644 (file)
@@ -229,15 +229,20 @@ void StatusBarMessageLabel::assureVisibleText()
         return;
     }
 
         return;
     }
 
-    // calculate the required height of the widget thats
-    // needed for having a fully visible text
-    QFontMetrics fontMetrics(font());
-    const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(),
-                       Qt::AlignVCenter | Qt::TextWordWrap,
-                       m_text));
-    int requiredHeight = bounds.height();
-    if (requiredHeight < m_minTextHeight) {
-        requiredHeight = m_minTextHeight;
+    int requiredHeight = m_minTextHeight;
+    if (m_type != DolphinStatusBar::Default) {
+        // Calculate the required height of the widget thats
+        // needed for having a fully visible text. Note that for the default
+        // statusbar type (e. g. hover information) increasing the text height
+        // is not wanted, as this might rearrange the layout of items.
+
+        QFontMetrics fontMetrics(font());
+        const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(),
+                           Qt::AlignVCenter | Qt::TextWordWrap, m_text));
+        requiredHeight = bounds.height();
+        if (requiredHeight < m_minTextHeight) {
+            requiredHeight = m_minTextHeight;
+        }
     }
 
     // Increase/decrease the current height of the widget to the
     }
 
     // Increase/decrease the current height of the widget to the