Do not use fixed widths for the widgets in the status bar

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
This commit is contained in:
Frank Reininghaus 2013-06-18 17:46:51 +02:00
parent bc9f7b8527
commit 030acf4f11
2 changed files with 10 additions and 15 deletions

View 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"

View file

@ -137,8 +137,6 @@ private:
*/
void updateZoomSliderToolTip(int zoomLevel);
void applyFixedWidgetSize(QWidget* widget, const QSize& size);
private:
QString m_text;
QString m_defaultText;