mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 14:35:51 +01:00
Merge d8158f12246388046632cbb2376ff850ce693f6b into a1af3c1a59fe81f7a1cac10dcead0a383b99f245
This commit is contained in:
commit
bbaf19099e
12
imgui.cpp
12
imgui.cpp
@ -12832,6 +12832,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.
|
||||
|
||||
1
imgui.h
1
imgui.h
@ -857,6 +857,7 @@ namespace ImGui
|
||||
// - BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards if returned true. ImGuiWindowFlags are forwarded to the window.
|
||||
// - BeginPopupModal(): block every interaction behind the window, cannot be closed by user, add a dimming background, has a title bar.
|
||||
IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it.
|
||||
IMGUI_API bool BeginPopup(ImGuiID id, ImGuiWindowFlags flags = 0); // id overload.
|
||||
IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // return true if the modal is open, and you can start outputting to it.
|
||||
IMGUI_API void EndPopup(); // only call EndPopup() if BeginPopupXXX() returns true!
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user