Fixes window ordering so popup message is visible without config open

This was a child of the config popup before.
Moves it to a child of the workspace instead so that if we had a load error the message is still visible
This commit is contained in:
Ryan Houdek committed 2021-04-01 19:16:03 -07:00
1 parent 59df3d13cc
commit be16cc1456
1 file changed
+17 -17
+17 -17
View File
@@ -579,26 +579,26 @@ namespace {
ImGui::EndPopup();
}
// Need this frame delay loop since ImGui doesn't allow us to enable a popup near the end of the frame
if (OpenMsgPopup) {
ImGui::OpenPopup(MsgPopupName);
OpenMsgPopup = false;
}
// Center the saved popup in the center of the window
ImGui::SetNextWindowPos(ImVec2(viewport->Pos.x + viewport->Size.x / 2, viewport->Pos.y + viewport->Size.y / 2), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (ImGui::BeginPopup(MsgPopupName)) {
ImGui::Text("%s", MsgMessage.c_str());
if ((std::chrono::high_resolution_clock::now() - MsgTimerStart) >= std::chrono::seconds(2)) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
ImGui::End();
}
// Need this frame delay loop since ImGui doesn't allow us to enable a popup near the end of the frame
if (OpenMsgPopup) {
ImGui::OpenPopup(MsgPopupName);
OpenMsgPopup = false;
}
// Center the saved popup in the center of the window
ImGui::SetNextWindowPos(ImVec2(viewport->Pos.x + viewport->Size.x / 2, viewport->Pos.y + viewport->Size.y / 2), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (ImGui::BeginPopup(MsgPopupName)) {
ImGui::Text("%s", MsgMessage.c_str());
if ((std::chrono::high_resolution_clock::now() - MsgTimerStart) >= std::chrono::seconds(2)) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
if (Selected.Open ||
(ImGui::IsKeyPressed(SDL_SCANCODE_O) && io.KeyCtrl && !io.KeyShift)) {
SelectedOpenFile = true;