mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Add option to hide entire status bar
This commit is contained in:
parent
2200e3c06d
commit
ba8158e2fa
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue