-/***************************************************************************
- * Copyright (C) 2006-2012 by Peter Penz <peter.penz19@gmail.com> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2006-2012 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
#include "dolphinstatusbar.h"
m_text(),
m_defaultText(),
m_label(nullptr),
+ m_zoomLabel(nullptr),
m_spaceInfo(nullptr),
m_zoomSlider(nullptr),
m_progressBar(nullptr),
m_label->setWordWrap(true);
m_label->setTextFormat(Qt::PlainText);
+ // Initialize zoom slider's explanatory label
+ m_zoomLabel = new QLabel(i18nc("Used as a noun, i.e. 'Here is the zoom level:'","Zoom:"), this);
+
// Initialize zoom widget
m_zoomSlider = new QSlider(Qt::Horizontal, this);
m_zoomSlider->setAccessibleName(i18n("Zoom"));
m_label->setFixedHeight(contentHeight);
m_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- m_zoomSlider->setMaximumWidth(fontMetrics.averageCharWidth() * 25);
+ m_zoomSlider->setMaximumWidth(fontMetrics.averageCharWidth() * 15);
- m_spaceInfo->setFixedHeight(zoomSliderHeight);
+ 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() * 25);
+ m_progressBar->setMaximumWidth(fontMetrics.averageCharWidth() * 20);
QHBoxLayout* topLayout = new QHBoxLayout(this);
topLayout->setContentsMargins(2, 0, 2, 0);
topLayout->setSpacing(4);
topLayout->addWidget(m_label, 1);
+ topLayout->addWidget(m_zoomLabel);
topLayout->addWidget(m_zoomSlider, 1);
topLayout->addWidget(m_spaceInfo, 1);
topLayout->addWidget(m_stopButton);
topLayout->addWidget(m_progressTextLabel);
topLayout->addWidget(m_progressBar);
+ setVisible(GeneralSettings::showStatusBar());
setExtensionsVisible(true);
setWhatsThis(xi18nc("@info:whatsthis Statusbar", "<para>This is "
"the <emphasis>Statusbar</emphasis>. It contains three elements "
void DolphinStatusBar::setUrl(const QUrl& url)
{
- m_spaceInfo->setUrl(url);
+ if (GeneralSettings::showSpaceInfo()) {
+ m_spaceInfo->setUrl(url);
+ }
}
QUrl DolphinStatusBar::url() const
void DolphinStatusBar::readSettings()
{
+ setVisible(GeneralSettings::showStatusBar());
setExtensionsVisible(true);
}
void DolphinStatusBar::contextMenuEvent(QContextMenuEvent* event)
{
- Q_UNUSED(event);
+ Q_UNUSED(event)
QMenu menu(this);
const bool visible = showZoomSliderAction->isChecked();
GeneralSettings::setShowZoomSlider(visible);
m_zoomSlider->setVisible(visible);
+ m_zoomLabel->setVisible(visible);
} else if (action == showSpaceInfoAction) {
const bool visible = showSpaceInfoAction->isChecked();
GeneralSettings::setShowSpaceInfo(visible);
showSpaceInfo = GeneralSettings::showSpaceInfo();
showZoomSlider = GeneralSettings::showZoomSlider();
}
+
+ m_spaceInfo->setShown(showSpaceInfo);
m_spaceInfo->setVisible(showSpaceInfo);
m_zoomSlider->setVisible(showZoomSlider);
+ m_zoomLabel->setVisible(showZoomSlider);
}