]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Do not use fixed widths for the widgets in the status bar
authorFrank Reininghaus <frank78ac@googlemail.com>
Tue, 18 Jun 2013 15:46:51 +0000 (17:46 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Tue, 18 Jun 2013 15:46:51 +0000 (17:46 +0200)
This fixes the problem that the Dolphin window has a rather large
minimum size. A side effect of this was that splitting the view could
resize the window (because twice the minimum status bar width was
needed then).

BUG: 319373
REVIEW: 110966
FIXED-IN: 4.10.5

src/statusbar/dolphinstatusbar.cpp
src/statusbar/dolphinstatusbar.h

index 068b6325a19e2e671a843c6d8093a79387e21fc1..6f734ed4d544478ada354ad41f3a679c85427a2c 100644 (file)
@@ -107,14 +107,18 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent) :
     const int zoomSliderHeight = m_zoomSlider->minimumSizeHint().height();
     const int contentHeight = qMax(fontHeight, zoomSliderHeight);
 
-    m_label->setMinimumHeight(contentHeight);
-    m_label->setMaximumHeight(contentHeight);
+    m_label->setFixedHeight(contentHeight);
     m_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
 
-    const QSize size(150, contentHeight);
-    applyFixedWidgetSize(m_spaceInfo, size);
-    applyFixedWidgetSize(m_progressBar, size);
-    applyFixedWidgetSize(m_zoomSlider, size);
+    m_zoomSlider->setFixedHeight(contentHeight);
+    m_zoomSlider->setMaximumWidth(150);
+
+    m_spaceInfo->setFixedHeight(contentHeight);
+    m_spaceInfo->setMaximumWidth(150);
+    m_spaceInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+
+    m_progressBar->setFixedHeight(contentHeight);
+    m_progressBar->setMaximumWidth(150);
 
     QHBoxLayout* topLayout = new QHBoxLayout(this);
     topLayout->setMargin(0);
@@ -349,11 +353,4 @@ void DolphinStatusBar::updateZoomSliderToolTip(int zoomLevel)
     m_zoomSlider->setToolTip(i18ncp("@info:tooltip", "Size: 1 pixel", "Size: %1 pixels", size));
 }
 
-void DolphinStatusBar::applyFixedWidgetSize(QWidget* widget, const QSize& size)
-{
-    widget->setMinimumSize(size);
-    widget->setMaximumSize(size);
-    widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-}
-
 #include "dolphinstatusbar.moc"
index d7e37f584c2204513895a5d018edc07318f83b62..b2afe2eb9f6da930658d62a6c0b04af9426a8d28 100644 (file)
@@ -137,8 +137,6 @@ private:
      */
     void updateZoomSliderToolTip(int zoomLevel);
 
-    void applyFixedWidgetSize(QWidget* widget, const QSize& size);
-
 private:
     QString m_text;
     QString m_defaultText;