Commit ba8158e2 authored by Michael Lang's avatar Michael Lang Committed by Méven Car
Browse files

Add option to hide entire status bar

parent 2200e3c0
Pipeline #56729 passed with stage
in 7 minutes and 27 seconds
......@@ -101,6 +101,10 @@
<label>Use auto-expanding folders for all view types</label>
<default>false</default>
</entry>
<entry name="ShowStatusBar" type="Bool">
<label>Show the statusbar</label>
<default>true</default>
</entry>
<entry name="ShowZoomSlider" type="Bool">
<label>Show zoom slider in the statusbar</label>
<default>true</default>
......
......@@ -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();
}
......@@ -29,8 +29,10 @@ public:
private:
void loadSettings();
void onShowStatusBarToggled();
private:
QCheckBox* m_showStatusBar;
QCheckBox* m_showZoomSlider;
QCheckBox* m_showSpaceInfo;
};
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment