From: Peter Penz Date: Sat, 29 Aug 2009 20:26:29 +0000 (+0000) Subject: - fixed issue that the horizontal progress bar and the space info bar get hidden... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/136e2ae3d75677ec008e7b5973b8e73bc38e9530?ds=sidebyside - fixed issue that the horizontal progress bar and the space info bar get hidden sometimes when changing the setting - use less vertical space for the capacity bar (thanks to Rafael Fernández López for the patch!) svn path=/trunk/KDE/kdebase/apps/; revision=1017172 --- diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index 802717423..c36651e0b 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -108,10 +108,10 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent, DolphinView* view) : // initialize sizes const int fontHeight = QFontMetrics(m_messageLabel->font()).height(); const int zoomWidgetHeight = m_zoomWidget->minimumSizeHint().height(); - const int contentHeight = (fontHeight < zoomWidgetHeight) ? zoomWidgetHeight : fontHeight; + const int contentHeight = qMax(fontHeight, zoomWidgetHeight); m_messageLabel->setMinimumTextHeight(contentHeight); - m_spaceInfo->setFixedHeight(contentHeight); + m_spaceInfo->setFixedHeight(contentHeight - 5); m_progressBar->setFixedSize(200, contentHeight); m_zoomWidget->setFixedSize(150, contentHeight); @@ -290,18 +290,13 @@ void DolphinStatusBar::assureVisibleText() if (m_spaceInfo->isVisible() || m_zoomWidget->isVisible()) { // At least the space information or the zoom slider is shown. // Hide them if the status bar text does not fit into the available width. - if (widthGap > 0) { - setExtensionsVisible(false); - } + setExtensionsVisible(widthGap <= 0); } else if (!m_progressBar->isVisible()) { const GeneralSettings* settings = DolphinSettings::instance().generalSettings(); const int spaceInfoWidth = settings->showSpaceInfo() ? m_spaceInfo->minimumWidth() : 0; const int zoomWidgetWidth = settings->showZoomSlider() ? m_zoomWidget->minimumWidth() : 0; const int widgetsWidth = spaceInfoWidth + zoomWidgetWidth; - - if (widthGap + widgetsWidth <= 0) { - setExtensionsVisible(true); - } + setExtensionsVisible(widthGap + widgetsWidth <= 0); } }