From d31f129407fa229e79f2beaa5172b643ee6d4ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 29 Sep 2022 18:51:21 +0200 Subject: [PATCH] Add hidden ini file setting that you can use to hide the menu bar. Windows-only. Useful together with some video recording software. Might make some actual UI later. --- Core/Config.cpp | 1 + Core/Config.h | 1 + Windows/MainWindow.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 3798362ef8..45e396c9b7 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -610,6 +610,7 @@ static ConfigSetting generalSettings[] = { ConfigSetting("PauseWhenMinimized", &g_Config.bPauseWhenMinimized, false, true, true), ConfigSetting("DumpDecryptedEboots", &g_Config.bDumpDecryptedEboot, false, true, true), ConfigSetting("FullscreenOnDoubleclick", &g_Config.bFullscreenOnDoubleclick, true, false, false), + ConfigSetting("ShowMenuBar", &g_Config.bShowMenuBar, true, true, false), ReportedConfigSetting("MemStickInserted", &g_Config.bMemStickInserted, true, true, true), ConfigSetting("EnablePlugins", &g_Config.bLoadPlugins, true, true, true), diff --git a/Core/Config.h b/Core/Config.h index 36ec3a760d..8a7f519621 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -191,6 +191,7 @@ public: int iWindowY; int iWindowWidth; // Windows and other windowed environments int iWindowHeight; + bool bShowMenuBar; // Windows-only float fUITint; float fUISaturation; diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index f483a55d9f..ebe755b979 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -353,8 +353,8 @@ namespace MainWindow ::SetWindowLong(hWnd, GWL_STYLE, dwStyle); - // Remove the menu bar. This can trigger WM_SIZE - ::SetMenu(hWnd, goingFullscreen ? NULL : menu); + // Remove the menu bar. This can trigger WM_SIZE because the contents change size. + ::SetMenu(hWnd, goingFullscreen || !g_Config.bShowMenuBar ? NULL : menu); if (g_Config.UseFullScreen() != goingFullscreen) { g_Config.bFullScreen = goingFullscreen;