mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-27 02:40:05 +00:00
Added ID overload to BeginPopup
This commit is contained in:
parent
fd0873c61f
commit
d8158f1224
2 changed files with 13 additions and 0 deletions
12
imgui.cpp
12
imgui.cpp
|
|
@ -12270,6 +12270,18 @@ bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
|
|||
return BeginPopupEx(id, flags);
|
||||
}
|
||||
|
||||
bool ImGui::BeginPopup(ImGuiID id, ImGuiWindowFlags flags)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.OpenPopupStack.Size <= g.BeginPopupStack.Size) // Early out for performance
|
||||
{
|
||||
g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
|
||||
return false;
|
||||
}
|
||||
flags |= ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings;
|
||||
return BeginPopupEx(id, flags);
|
||||
}
|
||||
|
||||
// If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup.
|
||||
// Note that popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup).
|
||||
// - *p_open set back to false in BeginPopupModal() when popup is not open.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue