Add "Show statusbar" menu entry in "Settings"

Makes this setting more accessible and makes it consistent with other
KDE applications. Since Dolphin has a separate status bar on each view
container and doesn't use kxmlgui's statusbar, we don't get this menu
entry automatically.
This commit is contained in:
Kai Uwe Broulik 2022-07-05 21:02:56 +02:00
parent c6f82aa378
commit 05941a522b
2 changed files with 13 additions and 0 deletions

View file

@ -1802,6 +1802,15 @@ void DolphinMainWindow::setupActions()
"contain mostly the same commands and configuration options."));
connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822
this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection);
KToggleAction* showStatusBar = KStandardAction::showStatusbar(nullptr, nullptr, actionCollection());
showStatusBar->setChecked(GeneralSettings::showStatusBar());
connect(GeneralSettings::self(), &GeneralSettings::showStatusBarChanged, showStatusBar, &KToggleAction::setChecked);
connect(showStatusBar, &KToggleAction::triggered, this, [this](bool checked) {
GeneralSettings::setShowStatusBar(checked);
refreshViews();
});
KStandardAction::keyBindings(this, &DolphinMainWindow::slotKeyBindings, actionCollection());
KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection());

View file

@ -10,6 +10,9 @@
<kcfgfile name="dolphinrc"/>
<signal name="sortingChoiceChanged" />
<signal name="splitViewChanged" />
<signal name="showStatusBarChanged">
<argument type="Bool">showStatusBar</argument>
</signal>
<group name="General">
<entry name="EditableUrl" type="Bool">
<label>Should the URL be editable for the user</label>
@ -106,6 +109,7 @@
<entry name="ShowStatusBar" type="Bool">
<label>Show the statusbar</label>
<default>true</default>
<emit signal="showStatusBarChanged" />
</entry>
<entry name="ShowZoomSlider" type="Bool">
<label>Show zoom slider in the statusbar</label>