|
|
|
@ -5748,7 +5748,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
|
|
if (window_just_activated_by_user)
|
|
|
|
|
{
|
|
|
|
|
window->AutoPosLastDirection = ImGuiDir_None;
|
|
|
|
|
if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api)
|
|
|
|
|
if ((flags & ImGuiWindowFlags_Popup) != 0 && !(flags & ImGuiWindowFlags_Modal) && !window_pos_set_by_api) // FIXME: BeginPopup() could use SetNextWindowPos()
|
|
|
|
|
window->Pos = g.BeginPopupStack.back().OpenPopupPos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -7807,6 +7807,7 @@ void ImGui::CloseCurrentPopup()
|
|
|
|
|
window->DC.NavHideHighlightOneFrame = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Attention! BeginPopup() adds default flags which BeginPopupEx()!
|
|
|
|
|
bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
|
|
|
|
|
{
|
|
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
@ -7855,12 +7856,13 @@ bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags fla
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Center modal windows by default
|
|
|
|
|
// Center modal windows by default for increased visibility
|
|
|
|
|
// (this won't really last as settings will kick in, and is mostly for backward compatibility. user may do the same themselves)
|
|
|
|
|
// FIXME: Should test for (PosCond & window->SetWindowPosAllowFlags) with the upcoming window.
|
|
|
|
|
if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) == 0)
|
|
|
|
|
SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
|
|
|
|
|
SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
|
|
|
|
|
|
|
|
|
|
flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings;
|
|
|
|
|
flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse;
|
|
|
|
|
const bool is_open = Begin(name, p_open, flags);
|
|
|
|
|
if (!is_open || (p_open && !*p_open)) // NB: is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
|
|
|
|
|
{
|
|
|
|
|