FullscreenUI: Fix debug menu being occluded

This commit is contained in:
Connor McLaughlin 2021-02-28 16:30:07 +10:00
parent 520b64e711
commit bc9ca302b8
2 changed files with 8 additions and 8 deletions

View File

@ -1128,7 +1128,7 @@ void DrawSettingsWindow()
"resume directly from where you left off next time.",
&s_settings_copy.save_state_on_exit);
settings_changed |=
ToggleButton("Start Fullscreen", "Automatically switches to fullscreen mode when a game is started.",
ToggleButton("Start Fullscreen", "Automatically switches to fullscreen mode when the program is started.",
&s_settings_copy.start_fullscreen);
settings_changed |=
ToggleButton("Load Devices From Save States",
@ -3118,7 +3118,7 @@ bool DrawConfirmWindow(const char* message, bool* result)
void SetDebugMenuAllowed(bool allowed)
{
s_debug_menu_enabled = allowed;
s_debug_menu_allowed = allowed;
UpdateDebugMenuVisibility();
}
@ -3126,6 +3126,7 @@ void SetDebugMenuEnabled(bool enabled)
{
s_host_interface->GetSettingsInterface()->SetBoolValue("Main", "ShowDebugMenu", enabled);
s_host_interface->GetSettingsInterface()->Save();
UpdateDebugMenuVisibility();
}
void UpdateDebugMenuVisibility()
@ -3431,9 +3432,8 @@ void DrawDebugSettingsMenu()
ImGui::EndMenu();
}
bool fullscreen = s_host_interface->IsFullscreen();
if (ImGui::MenuItem("Fullscreen", nullptr, &fullscreen))
s_host_interface->RunLater([fullscreen] { s_host_interface->SetFullscreen(fullscreen); });
if (ImGui::MenuItem("Toggle Fullscreen"))
s_host_interface->RunLater([] { s_host_interface->SetFullscreen(!s_host_interface->IsFullscreen()); });
if (ImGui::BeginMenu("Resize to Game", System::IsValid()))
{

View File

@ -236,8 +236,8 @@ void EndLayout()
bool BeginFullscreenColumns(const char* title)
{
ImGui::SetNextWindowPos(ImVec2(g_layout_padding_left, 0.0f));
ImGui::SetNextWindowSize(ImVec2(LayoutScale(LAYOUT_SCREEN_WIDTH), ImGui::GetIO().DisplaySize.y));
ImGui::SetNextWindowPos(ImVec2(g_layout_padding_left, s_menu_bar_size));
ImGui::SetNextWindowSize(ImVec2(LayoutScale(LAYOUT_SCREEN_WIDTH), ImGui::GetIO().DisplaySize.y - s_menu_bar_size));
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
@ -268,7 +268,7 @@ void EndFullscreenColumns()
bool BeginFullscreenColumnWindow(float start, float end, const char* name, const ImVec4& background)
{
const ImVec2 pos(LayoutScale(start), 0.0f);
const ImVec2 size(LayoutScale(end - start), ImGui::GetIO().DisplaySize.y);
const ImVec2 size(LayoutScale(end - start), ImGui::GetIO().DisplaySize.y - s_menu_bar_size);
ImGui::PushStyleColor(ImGuiCol_ChildBg, background);