FullscreenUI: Fix some dialogs not being cancellable
i.e. exitable with right mouse click/B button.
This commit is contained in:
parent
db3b689166
commit
4bac7cb79e
|
@ -4659,7 +4659,8 @@ void FullscreenUI::DrawControllerSettingsPage()
|
|||
|
||||
ImGui::SetNextWindowSize(LayoutScale(500.0f, 180.0f));
|
||||
|
||||
if (BeginFixedPopupModal(freq_label, nullptr))
|
||||
bool is_open = true;
|
||||
if (BeginFixedPopupModal(freq_label, &is_open))
|
||||
{
|
||||
ImGui::SetNextItemWidth(LayoutScale(450.0f));
|
||||
if (ImGui::SliderInt("##value", &frequency, 0, 60, FSUI_CSTR("Toggle every %d frames"),
|
||||
|
|
|
@ -650,6 +650,12 @@ bool ImGuiFullscreen::BeginFixedPopupModal(const char* name, bool* p_open)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (p_open && *p_open && WantsToCloseMenu())
|
||||
{
|
||||
*p_open = false;
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
// don't draw unreadable text
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor);
|
||||
return true;
|
||||
|
@ -2816,6 +2822,9 @@ void ImGuiFullscreen::DrawMessageDialog()
|
|||
|
||||
if (ImGui::BeginPopupModal(win_id, &is_open, flags))
|
||||
{
|
||||
if (WantsToCloseMenu())
|
||||
is_open = false;
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.BackgroundTextColor);
|
||||
|
||||
ResetFocusHere();
|
||||
|
|
Loading…
Reference in New Issue