diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg
index bc1cf72aab..728d116346 100644
--- a/src/settings/dolphin_generalsettings.kcfg
+++ b/src/settings/dolphin_generalsettings.kcfg
@@ -101,6 +101,10 @@
false
+
+
+ true
+
true
diff --git a/src/settings/general/statusbarsettingspage.cpp b/src/settings/general/statusbarsettingspage.cpp
index ddefa1a402..9d90a64fdb 100644
--- a/src/settings/general/statusbarsettingspage.cpp
+++ b/src/settings/general/statusbarsettingspage.cpp
@@ -15,19 +15,24 @@
StatusBarSettingsPage::StatusBarSettingsPage(QWidget* parent) :
SettingsPageBase(parent),
+ m_showStatusBar(nullptr),
m_showZoomSlider(nullptr),
m_showSpaceInfo(nullptr)
{
+ m_showStatusBar = new QCheckBox(i18nc("@option:check", "Show status bar"), this);
m_showZoomSlider = new QCheckBox(i18nc("@option:check", "Show zoom slider"), this);
m_showSpaceInfo = new QCheckBox(i18nc("@option:check", "Show space information"), this);
QVBoxLayout* topLayout = new QVBoxLayout(this);
+ topLayout->addWidget(m_showStatusBar);
topLayout->addWidget(m_showZoomSlider);
topLayout->addWidget(m_showSpaceInfo);
topLayout->addStretch();
loadSettings();
+ connect(m_showStatusBar, &QCheckBox::toggled, this, &StatusBarSettingsPage::changed);
+ connect(m_showStatusBar, &QCheckBox::toggled, this, &StatusBarSettingsPage::onShowStatusBarToggled);
connect(m_showZoomSlider, &QCheckBox::toggled, this, &StatusBarSettingsPage::changed);
connect(m_showSpaceInfo, &QCheckBox::toggled, this, &StatusBarSettingsPage::changed);
}
@@ -36,9 +41,17 @@ StatusBarSettingsPage::~StatusBarSettingsPage()
{
}
+void StatusBarSettingsPage::onShowStatusBarToggled()
+{
+ const bool checked = m_showStatusBar->isChecked();
+ m_showZoomSlider->setEnabled(checked);
+ m_showSpaceInfo->setEnabled(checked);
+}
+
void StatusBarSettingsPage::applySettings()
{
GeneralSettings* settings = GeneralSettings::self();
+ settings->setShowStatusBar(m_showStatusBar->isChecked());
settings->setShowZoomSlider(m_showZoomSlider->isChecked());
settings->setShowSpaceInfo(m_showSpaceInfo->isChecked());
settings->save();
@@ -54,7 +67,10 @@ void StatusBarSettingsPage::restoreDefaults()
void StatusBarSettingsPage::loadSettings()
{
+ m_showStatusBar->setChecked(GeneralSettings::showStatusBar());
m_showZoomSlider->setChecked(GeneralSettings::showZoomSlider());
m_showSpaceInfo->setChecked(GeneralSettings::showSpaceInfo());
+
+ onShowStatusBarToggled();
}
diff --git a/src/settings/general/statusbarsettingspage.h b/src/settings/general/statusbarsettingspage.h
index 3c5e7c2ad6..af8e061641 100644
--- a/src/settings/general/statusbarsettingspage.h
+++ b/src/settings/general/statusbarsettingspage.h
@@ -29,8 +29,10 @@ public:
private:
void loadSettings();
+ void onShowStatusBarToggled();
private:
+ QCheckBox* m_showStatusBar;
QCheckBox* m_showZoomSlider;
QCheckBox* m_showSpaceInfo;
};
diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp
index 91c843366e..8ac74e71f0 100644
--- a/src/statusbar/dolphinstatusbar.cpp
+++ b/src/statusbar/dolphinstatusbar.cpp
@@ -321,12 +321,15 @@ void DolphinStatusBar::updateZoomSliderToolTip(int zoomLevel)
void DolphinStatusBar::setExtensionsVisible(bool visible)
{
+ bool showStatusBar = visible;
bool showSpaceInfo = visible;
bool showZoomSlider = visible;
if (visible) {
+ showStatusBar = GeneralSettings::showStatusBar();
showSpaceInfo = GeneralSettings::showSpaceInfo();
showZoomSlider = GeneralSettings::showZoomSlider();
}
+ setVisible(showStatusBar);
m_spaceInfo->setShown(showSpaceInfo);
m_spaceInfo->setVisible(showSpaceInfo);
m_zoomSlider->setVisible(showZoomSlider);