1
0
mirror of synced 2025-01-29 19:17:28 +01:00

fix: Make sure store and about page are opened correctly

This commit is contained in:
WerWolv 2023-11-23 13:08:45 +01:00
parent b619744093
commit 5a58ed5114
4 changed files with 5 additions and 5 deletions

View File

@ -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();

View File

@ -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 }); }

View File

@ -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;
});

View File

@ -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;
});