BeginPopupModal() doesn't set the ImGuiWindowFlags_NoSavedSettings flag anymore, and will not always be auto-centered. (#915, #3091)

This commit is contained in:
omar
2020-06-23 17:52:13 +02:00
parent 68389200c4
commit b83a1f3b00
3 changed files with 14 additions and 4 deletions

View File

@ -2865,6 +2865,10 @@ static void ShowDemoWindowPopups()
if (ImGui::Button("Delete.."))
ImGui::OpenPopup("Delete?");
// Always center this window when appearing
ImVec2 center(ImGui::GetIO().DisplaySize.x * 0.5f, ImGui::GetIO().DisplaySize.y * 0.5f);
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize))
{
ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n");