mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Fixed CloseCurrentPopup() on a child-menu of a modal incorrectly closing the modal. (#2308)
This commit is contained in:
@ -2171,13 +2171,24 @@ static void ShowDemoWindowPopups()
|
||||
|
||||
if (ImGui::Button("Stacked modals.."))
|
||||
ImGui::OpenPopup("Stacked 1");
|
||||
if (ImGui::BeginPopupModal("Stacked 1"))
|
||||
if (ImGui::BeginPopupModal("Stacked 1", NULL, ImGuiWindowFlags_MenuBar))
|
||||
{
|
||||
if (ImGui::BeginMenuBar())
|
||||
{
|
||||
if (ImGui::BeginMenu("File"))
|
||||
{
|
||||
if (ImGui::MenuItem("Dummy menu item")) {}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
ImGui::Text("Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it.");
|
||||
|
||||
// Testing behavior of widgets stacking their own regular popups over the modal.
|
||||
static int item = 1;
|
||||
ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
|
||||
static float color[4] = { 0.4f,0.7f,0.0f,0.5f };
|
||||
ImGui::ColorEdit4("color", color); // This is to test behavior of stacked regular popups over a modal
|
||||
ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
|
||||
ImGui::ColorEdit4("color", color);
|
||||
|
||||
if (ImGui::Button("Add another modal.."))
|
||||
ImGui::OpenPopup("Stacked 2");
|
||||
|
Reference in New Issue
Block a user