mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-16 20:07:18 +01:00
Fixed context popup windows from not having the NoDocking flag. (#2763)
This commit is contained in:
parent
483534b525
commit
a01d149369
@ -8276,7 +8276,7 @@ void ImGui::CloseCurrentPopup()
|
||||
window->DC.NavHideHighlightOneFrame = true;
|
||||
}
|
||||
|
||||
bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags)
|
||||
bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (!IsPopupOpen(id))
|
||||
@ -8286,12 +8286,13 @@ bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags)
|
||||
}
|
||||
|
||||
char name[20];
|
||||
if (extra_flags & ImGuiWindowFlags_ChildMenu)
|
||||
if (flags & ImGuiWindowFlags_ChildMenu)
|
||||
ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginPopupStack.Size); // Recycle windows based on depth
|
||||
else
|
||||
ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame
|
||||
|
||||
bool is_open = Begin(name, NULL, extra_flags | ImGuiWindowFlags_Popup);
|
||||
flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoDocking;
|
||||
bool is_open = Begin(name, NULL, flags);
|
||||
if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display)
|
||||
EndPopup();
|
||||
|
||||
@ -8306,7 +8307,7 @@ bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
|
||||
g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
|
||||
return false;
|
||||
}
|
||||
flags |= ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoDocking;
|
||||
flags |= ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings;
|
||||
return BeginPopupEx(g.CurrentWindow->GetID(str_id), flags);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user