mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Menus: fixed closing a menu inside a popup/modal. Fixed menu inside a popup/modal not inhibiting hovering of items in the popup/modal. (#3496, #4797)
Fixed sub-menu items inside a popups from closing the popup (debatable).
This commit is contained in:
@ -3345,11 +3345,26 @@ static void ShowDemoWindowPopups()
|
||||
}
|
||||
|
||||
// Call the more complete ShowExampleMenuFile which we use in various places of this demo
|
||||
if (ImGui::Button("File Menu.."))
|
||||
if (ImGui::Button("With a menu.."))
|
||||
ImGui::OpenPopup("my_file_popup");
|
||||
if (ImGui::BeginPopup("my_file_popup"))
|
||||
if (ImGui::BeginPopup("my_file_popup", ImGuiWindowFlags_MenuBar))
|
||||
{
|
||||
ShowExampleMenuFile();
|
||||
if (ImGui::BeginMenuBar())
|
||||
{
|
||||
if (ImGui::BeginMenu("File"))
|
||||
{
|
||||
ShowExampleMenuFile();
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
if (ImGui::BeginMenu("Edit"))
|
||||
{
|
||||
ImGui::MenuItem("Dummy");
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::EndMenuBar();
|
||||
}
|
||||
ImGui::Text("Hello from popup!");
|
||||
ImGui::Button("This is a dummy button..");
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user