Commit 9763d196 authored by Felix Ernst's avatar Felix Ernst
Browse files

Hide the menu bar by default

This commit hides the menu bar for new installations by default.
This is done by introducing a setting to save if Gwenview was
ever started before. Unfortunately this check doesn't work for
upgrading users so the menu bar is hidden only if a hamburger menu
action is currently in the toolbar which can only be the case if
it is a new installation.

Motivation:
With the hamburger menu now visible on the toolbar by default, we
can now hide the menu bar by default without having to fear that
users won't be able to access Gwenview's features.

Hiding the menu bar by default makes sense because Gwenview is
supposed to be a simple image viewer meaning that users shouldn't
need fast access to the plethora of actions in the menu bar.

Hiding the menu bar by default increases the default area available
for showing an image and directs users to be instead more aware of
the select view actions which remain visible on the UI.
parent 3f269685
......@@ -1824,6 +1824,10 @@ void MainWindow::saveConfig()
d->mContextManager->saveConfig();
d->saveSplitterConfig();
GwenviewConfig::setFullScreenModeActive(isFullScreen());
// Save the last used version when Gwenview closes so we know which settings/features the user
// is aware of which is needed for migration. The version format is: two digits each for
// major minor bugfix version. Never decrease this number. Increase it when needed.
GwenviewConfig::setLastUsedVersion(210800);
}
void MainWindow::print()
......@@ -1889,6 +1893,11 @@ void MainWindow::showEvent(QShowEvent *event)
{
// We need to delay initializing the action state until the menu bar has
// been initialized, that's why it's done only in the showEvent()
if (GwenviewConfig::lastUsedVersion() == -1
&& toolBar()->actions().contains(d->mHamburgerMenu)
) {
menuBar()->hide();
}
d->mShowMenuBarAction->setChecked(menuBar()->isVisible());
KXmlGuiWindow::showEvent(event);
}
......
......@@ -112,6 +112,9 @@
</choices>
<default>ThumbnailActions::AllButtons</default>
</entry>
<entry name="LastUsedVersion" type="int">
<default>-1</default>
</entry>
</group>
<group name="FullScreen">
......
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