From 25455cb7aa55178070ffe257d7101354a8f515bf Mon Sep 17 00:00:00 2001 From: Madhav Kanbur Date: Tue, 5 Jan 2021 16:07:27 +0530 Subject: [PATCH] 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 * Don't modify menubar width when exiting fullscreen * Fixes weird looking menubar on Windows Signed-off-by: Madhav Kanbur --- src/frontend/qt_sdl/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index fca69400..33db28fd 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -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); } }