From e8f0a3bd23b5ecaadc167ce772ead3073639344d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 4 Dec 2023 22:32:25 +0100 Subject: [PATCH] impr: Force center modal views --- lib/libimhex/include/hex/ui/view.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libimhex/include/hex/ui/view.hpp b/lib/libimhex/include/hex/ui/view.hpp index d43472b26..8dac7e651 100644 --- a/lib/libimhex/include/hex/ui/view.hpp +++ b/lib/libimhex/include/hex/ui/view.hpp @@ -171,6 +171,7 @@ namespace hex { if (this->getWindowOpenState()) ImGui::OpenPopup(View::toWindowName(this->getUnlocalizedName()).c_str()); + ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Appearing, ImVec2(0.5F, 0.5F)); if (ImGui::BeginPopupModal(View::toWindowName(this->getUnlocalizedName()).c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | this->getWindowFlags())) { this->drawContent();