X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/be9746e87bb6a42e641dbf36c528a60fb564420a..d6488887ecf69d7f192b94de8dce34fae0b7eb76:/src/dolphinstatusbar.cpp diff --git a/src/dolphinstatusbar.cpp b/src/dolphinstatusbar.cpp index edf242e66..df67ac28f 100644 --- a/src/dolphinstatusbar.cpp +++ b/src/dolphinstatusbar.cpp @@ -51,21 +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); - - connect(parent, SIGNAL(urlChanged(const KUrl&)), - this, SLOT(updateSpaceInfoContent(const KUrl&))); + m_spaceInfo->setFixedHeight(contentHeight); + m_progressBar->setFixedHeight(contentHeight); + m_progressBar->setMaximumWidth(200); } DolphinStatusBar::~DolphinStatusBar() -{} +{ +} void DolphinStatusBar::setMessage(const QString& msg, Type type) @@ -147,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() @@ -183,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(); }