]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinstatusbar.cpp
SVN_SILENT made messages (.desktop file)
[dolphin.git] / src / dolphinstatusbar.cpp
index b2c621dbdfca69a71b991adc56cd3cd9a10fd64b..df67ac28f5fef43339b8a7993c1a0971f7f0d8e2 100644 (file)
@@ -51,18 +51,20 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent, const KUrl& url) :
     m_progressBar = new QProgressBar(this);
     m_progressBar->hide();
 
-    const QSize size(m_progressBar->sizeHint());
-    const int barHeight = size.height();
+    const int contentHeight = QFontMetrics(m_messageLabel->font()).height();
+    const int barHeight = contentHeight + 8;
 
-    m_progressBar->setMaximumWidth(200);
     setMinimumHeight(barHeight);
     m_messageLabel->setMinimumTextHeight(barHeight);
-    m_spaceInfo->setFixedHeight(barHeight);
+    m_spaceInfo->setFixedHeight(contentHeight);
+    m_progressBar->setFixedHeight(contentHeight);
+    m_progressBar->setMaximumWidth(200);
 }
 
 
 DolphinStatusBar::~DolphinStatusBar()
-{}
+{
+}
 
 void DolphinStatusBar::setMessage(const QString& msg,
                                   Type type)
@@ -144,7 +146,7 @@ const QString& DolphinStatusBar::defaultText() const
 void DolphinStatusBar::resizeEvent(QResizeEvent* event)
 {
     QWidget::resizeEvent(event);
-    QTimer::singleShot(0, this, SLOT(showSpaceInfo()));
+    QMetaObject::invokeMethod(this, "showSpaceInfo", Qt::QueuedConnection);
 }
 
 void DolphinStatusBar::updateProgressInfo()
@@ -180,7 +182,6 @@ void DolphinStatusBar::showSpaceInfo()
         // The space information is shown currently. Hide it
         // if the progress bar is visible or if the status bar
         // text does not fit into the available width.
-        const QSize size(m_progressBar->sizeHint());
         if (isProgressBarVisible || (widthGap > 0)) {
             m_spaceInfo->hide();
         }