diff --git a/lib/libimhex/include/hex/ui/view.hpp b/lib/libimhex/include/hex/ui/view.hpp index 5afaded3e..5a315d147 100644 --- a/lib/libimhex/include/hex/ui/view.hpp +++ b/lib/libimhex/include/hex/ui/view.hpp @@ -123,7 +123,6 @@ namespace hex { void draw() final { if (this->shouldDraw()) { ImGui::SetNextWindowSizeConstraints(this->getMinSize(), this->getMaxSize()); - if (ImGui::Begin(View::toWindowName(this->getUnlocalizedName()).c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse | this->getWindowFlags())) { this->drawContent(); } @@ -168,6 +167,9 @@ namespace hex { if (this->shouldDraw()) { ImGui::SetNextWindowSizeConstraints(this->getMinSize(), this->getMaxSize()); + if (this->getWindowOpenState()) + ImGui::OpenPopup(View::toWindowName(this->getUnlocalizedName()).c_str()); + if (ImGui::BeginPopupModal(View::toWindowName(this->getUnlocalizedName()).c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse | this->getWindowFlags())) { this->drawContent(); diff --git a/plugins/builtin/include/content/views/view_store.hpp b/plugins/builtin/include/content/views/view_store.hpp index 3c1fd91e0..0eddc2c1f 100644 --- a/plugins/builtin/include/content/views/view_store.hpp +++ b/plugins/builtin/include/content/views/view_store.hpp @@ -51,7 +51,7 @@ namespace hex::plugin::builtin { void drawContent() override; - [[nodiscard]] bool shouldDraw() const override { return false; } + [[nodiscard]] bool shouldDraw() const override { return true; } [[nodiscard]] bool hasViewMenuItemEntry() const override { return false; } [[nodiscard]] ImVec2 getMinSize() const override { return scaled({ 600, 400 }); } diff --git a/plugins/builtin/source/content/views/view_about.cpp b/plugins/builtin/source/content/views/view_about.cpp index 9820429ed..05077c859 100644 --- a/plugins/builtin/source/content/views/view_about.cpp +++ b/plugins/builtin/source/content/views/view_about.cpp @@ -17,10 +17,8 @@ namespace hex::plugin::builtin { ViewAbout::ViewAbout() : View::Modal("hex.builtin.view.help.about.name") { - // Add "About" menu item to the help menu ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.help", "hex.builtin.view.help.about.name" }, 1000, Shortcut::None, [this] { - TaskManager::doLater([this] { ImGui::OpenPopup(View::toWindowName(this->getUnlocalizedName()).c_str()); }); this->getWindowOpenState() = true; }); diff --git a/plugins/builtin/source/content/views/view_store.cpp b/plugins/builtin/source/content/views/view_store.cpp index f318b35fc..f371dbfa2 100644 --- a/plugins/builtin/source/content/views/view_store.cpp +++ b/plugins/builtin/source/content/views/view_store.cpp @@ -31,7 +31,7 @@ namespace hex::plugin::builtin { ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.store.name" }, 1000, Shortcut::None, [&, this] { if (this->m_requestStatus == RequestStatus::NotAttempted) this->refresh(); - TaskManager::doLater([this] { ImGui::OpenPopup(View::toWindowName(this->getUnlocalizedName()).c_str()); }); + this->getWindowOpenState() = true; });