X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/275d7b537de4bf6db971c9cb1d591ffe512272f9..40cc5f665d:/src/statusbar/dolphinstatusbar.cpp diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index 6cd76bb60..70ebe0c3c 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -1,21 +1,8 @@ -/*************************************************************************** - * Copyright (C) 2006-2012 by Peter Penz * - * * - * 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 + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "dolphinstatusbar.h" @@ -34,7 +21,6 @@ #include #include #include -#include #include #include @@ -47,6 +33,7 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent) : m_text(), m_defaultText(), m_label(nullptr), + m_zoomLabel(nullptr), m_spaceInfo(nullptr), m_zoomSlider(nullptr), m_progressBar(nullptr), @@ -61,6 +48,9 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent) : 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")); @@ -113,25 +103,27 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent) : 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(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", "This is " "the Statusbar. It contains three elements " @@ -253,6 +245,7 @@ int DolphinStatusBar::zoomLevel() const void DolphinStatusBar::readSettings() { + setVisible(GeneralSettings::showStatusBar()); setExtensionsVisible(true); } @@ -280,6 +273,7 @@ void DolphinStatusBar::contextMenuEvent(QContextMenuEvent* event) 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); @@ -334,7 +328,10 @@ void DolphinStatusBar::setExtensionsVisible(bool visible) showSpaceInfo = GeneralSettings::showSpaceInfo(); showZoomSlider = GeneralSettings::showZoomSlider(); } + m_spaceInfo->setShown(showSpaceInfo); + m_spaceInfo->setVisible(showSpaceInfo); m_zoomSlider->setVisible(showZoomSlider); + m_zoomLabel->setVisible(showZoomSlider); }