X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/664f97ff0d1c70f7df4f4fa32303949ee7a6e8fb..9e8e58147:/src/statusbar/dolphinstatusbar.cpp diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index a7585bed0..91c843366 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" @@ -47,6 +34,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 +49,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,19 +104,20 @@ 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); @@ -229,7 +221,9 @@ QString DolphinStatusBar::defaultText() const void DolphinStatusBar::setUrl(const QUrl& url) { - m_spaceInfo->setUrl(url); + if (GeneralSettings::showSpaceInfo()) { + m_spaceInfo->setUrl(url); + } } QUrl DolphinStatusBar::url() const @@ -278,6 +272,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); @@ -332,7 +327,9 @@ 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); }