aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMadhav Kanbur <abcdjdj@gmail.com>2021-01-05 16:07:27 +0530
committerGitHub <noreply@github.com>2021-01-05 11:37:27 +0100
commit25455cb7aa55178070ffe257d7101354a8f515bf (patch)
tree5c9fecb97b401b87894fa95f64855571ff80f8ca /src
parent6e3207f9dcb35291248b0312b126601765555a15 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/frontend/qt_sdl/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index fca6940..33db28f 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);
}
}