┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-10-09 21:32:06 +0000
committerPeter Penz <[email protected]>2008-10-09 21:32:06 +0000
commit9e42591422599edffa09fca418f441a98ea9efe5 (patch)
treeb647817abd996ce0de5a7fbee91aa84e25dbac67
parenta6754078cc3a2019453ba7ff770700a3ffc0e6d1 (diff)
assure that the zoom slider/capacity bar gets hidden correctly if the width is too small for having a fitting text
svn path=/trunk/KDE/kdebase/apps/; revision=869727
-rw-r--r--src/dolphinstatusbar.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/dolphinstatusbar.cpp b/src/dolphinstatusbar.cpp
index fae0eccdf..069cc7450 100644
--- a/src/dolphinstatusbar.cpp
+++ b/src/dolphinstatusbar.cpp
@@ -107,12 +107,8 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent, DolphinView* view) :
setMinimumHeight(barHeight);
m_messageLabel->setMinimumTextHeight(barHeight);
m_spaceInfo->setFixedHeight(contentHeight);
-
- m_progressBar->setFixedHeight(contentHeight);
- m_progressBar->setMaximumWidth(200);
-
- m_zoomWidget->setMaximumWidth(150);
- m_zoomWidget->setFixedHeight(contentHeight);
+ m_progressBar->setFixedSize(200, contentHeight);
+ m_zoomWidget->setFixedSize(150, contentHeight);
setExtensionsVisible(true);
}
@@ -124,6 +120,10 @@ DolphinStatusBar::~DolphinStatusBar()
void DolphinStatusBar::setMessage(const QString& msg,
Type type)
{
+ if ((msg == m_messageLabel->text()) && (type == m_messageLabel->type())) {
+ return;
+ }
+
m_messageLabel->setMessage(msg, type);
const int widthGap = m_messageLabel->widthGap();
@@ -244,20 +244,21 @@ void DolphinStatusBar::setZoomLevel(int zoomLevel)
void DolphinStatusBar::assureVisibleText()
{
const int widthGap = m_messageLabel->widthGap();
- const bool isProgressBarVisible = m_progressBar->isVisible();
-
- const int spaceInfoWidth = m_spaceInfo->isVisible() ? m_spaceInfo->width() : 0;
- const int zoomWidgetWidth = m_zoomWidget->isVisible() ? m_zoomWidget->width() : 0;
- const int widgetsWidth = spaceInfoWidth + zoomWidgetWidth;
-
- if (widgetsWidth > 0) {
- // The space information and (or) the zoom slider are (is) shown.
+ 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);
}
- } else if (!isProgressBarVisible && (widthGap + widgetsWidth <= 0)) {
- setExtensionsVisible(true);
+ } 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);
+ }
}
}