Set menubar height to 0 in fullscreen (#924)

* Set menubar height to 0 in fullscreen

* Avoid using hide() on the mainwindow's menubar as it breaks menubar
actions.

* Fixes save/load state shortcuts not working in fullscreen (#922)

Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com>

* Don't modify menubar width when exiting fullscreen

* Fixes weird looking menubar on Windows

Signed-off-by: Madhav Kanbur <abcdjdj@gmail.com>
This commit is contained in:
Madhav Kanbur 2021-01-05 16:07:27 +05:30 committed by GitHub
parent 6e3207f9dc
commit 25455cb7aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1991,12 +1991,13 @@ void MainWindow::onFullscreenToggled()
if (!mainWindow->isFullScreen())
{
mainWindow->showFullScreen();
mainWindow->menuBar()->hide();
mainWindow->menuBar()->setFixedHeight(0); // Don't use hide() as menubar actions stop working
}
else
{
mainWindow->showNormal();
mainWindow->menuBar()->show();
int menuBarHeight = mainWindow->menuBar()->sizeHint().height();
mainWindow->menuBar()->setFixedHeight(menuBarHeight);
}
}