]> cloud.milkyroute.net Git - dolphin.git/commitdiff
- fixed issue that the horizontal progress bar and the space info bar get hidden...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 29 Aug 2009 20:26:29 +0000 (20:26 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 29 Aug 2009 20:26:29 +0000 (20:26 +0000)
- 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

src/statusbar/dolphinstatusbar.cpp

index 802717423449846a7b189ac79cf26e93bae787d9..c36651e0b6547eae8035b321cc8171fdb3c12144 100644 (file)
@@ -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();
     // 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_messageLabel->setMinimumTextHeight(contentHeight);
-    m_spaceInfo->setFixedHeight(contentHeight);
+    m_spaceInfo->setFixedHeight(contentHeight - 5);
     m_progressBar->setFixedSize(200, contentHeight);
     m_zoomWidget->setFixedSize(150, contentHeight);
 
     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 (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;
     } 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);
     }
 }
 
     }
 }