- // initialize sizes
- const int fontHeight = QFontMetrics(m_messageLabel->font()).height();
- const int zoomWidgetHeight = m_zoomWidget->minimumSizeHint().height();
- const int contentHeight = qMax(fontHeight, zoomWidgetHeight);
-
- m_messageLabel->setMinimumTextHeight(contentHeight);
- m_spaceInfo->setFixedHeight(contentHeight - 5);
- m_progressBar->setFixedSize(200, contentHeight);
- m_zoomWidget->setFixedSize(150, contentHeight);
-
- setExtensionsVisible(true);
+ m_showProgressBarTimer = new QTimer(this);
+ m_showProgressBarTimer->setInterval(500);
+ m_showProgressBarTimer->setSingleShot(true);
+ connect(m_showProgressBarTimer, &QTimer::timeout, this, &DolphinStatusBar::updateProgressInfo);
+
+ // initialize text updater delay timer
+ m_delayUpdateTimer = new QTimer(this);
+ m_delayUpdateTimer->setInterval(UpdateDelay);
+ m_delayUpdateTimer->setSingleShot(true);
+ connect(m_delayUpdateTimer, &QTimer::timeout, this, &DolphinStatusBar::updateLabelText);
+
+ // Initialize top layout and size policies
+ const int fontHeight = QFontMetrics(m_label->font()).height();
+ const int zoomSliderHeight = m_zoomSlider->minimumSizeHint().height();
+ const int buttonHeight = m_stopButton->height();
+ const int contentHeight = qMax(qMax(fontHeight, zoomSliderHeight), buttonHeight);
+
+ QFontMetrics fontMetrics(m_label->font());
+
+ m_label->setFixedHeight(contentHeight);
+ m_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+
+ m_zoomSlider->setMaximumWidth(fontMetrics.averageCharWidth() * 15);
+
+ m_spaceInfo->setFixedHeight(contentHeight);
+ m_spaceInfo->setMaximumWidth(fontMetrics.averageCharWidth() * 25);
+ m_spaceInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+
+ m_progressBar->setFixedHeight(zoomSliderHeight);
+ m_progressBar->setMaximumWidth(fontMetrics.averageCharWidth() * 20);
+
+ m_topLayout = new QHBoxLayout(contentsContainer);
+ updateContentsMargins();
+ m_topLayout->setSpacing(4);
+ m_topLayout->addWidget(m_label, 1);
+ m_topLayout->addWidget(m_zoomLabel);
+ m_topLayout->addWidget(m_zoomSlider, 1);
+ m_topLayout->addWidget(m_spaceInfo, 1);
+ m_topLayout->addWidget(m_stopButton);
+ m_topLayout->addWidget(m_progressTextLabel);
+ m_topLayout->addWidget(m_progressBar);
+
+ readSettings();
+ setWhatsThis(xi18nc("@info:whatsthis Statusbar",
+ "<para>This is "
+ "the <emphasis>Statusbar</emphasis>. It contains three elements "
+ "by default (left to right):<list><item>A <emphasis>text field"
+ "</emphasis> that displays the size of selected items. If only "
+ "one item is selected the name and type is shown as well.</item>"
+ "<item>A <emphasis>zoom slider</emphasis> that allows you "
+ "to adjust the size of the icons in the view.</item>"
+ "<item><emphasis>Space information</emphasis> about the "
+ "current storage device.</item></list></para>"));