fix: Make sure store and about page are opened correctly
This commit is contained in:
parent
b619744093
commit
5a58ed5114
@ -123,7 +123,6 @@ namespace hex {
|
|||||||
void draw() final {
|
void draw() final {
|
||||||
if (this->shouldDraw()) {
|
if (this->shouldDraw()) {
|
||||||
ImGui::SetNextWindowSizeConstraints(this->getMinSize(), this->getMaxSize());
|
ImGui::SetNextWindowSizeConstraints(this->getMinSize(), this->getMaxSize());
|
||||||
|
|
||||||
if (ImGui::Begin(View::toWindowName(this->getUnlocalizedName()).c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse | this->getWindowFlags())) {
|
if (ImGui::Begin(View::toWindowName(this->getUnlocalizedName()).c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse | this->getWindowFlags())) {
|
||||||
this->drawContent();
|
this->drawContent();
|
||||||
}
|
}
|
||||||
@ -168,6 +167,9 @@ namespace hex {
|
|||||||
if (this->shouldDraw()) {
|
if (this->shouldDraw()) {
|
||||||
ImGui::SetNextWindowSizeConstraints(this->getMinSize(), this->getMaxSize());
|
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())) {
|
if (ImGui::BeginPopupModal(View::toWindowName(this->getUnlocalizedName()).c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse | this->getWindowFlags())) {
|
||||||
this->drawContent();
|
this->drawContent();
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
void drawContent() override;
|
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]] bool hasViewMenuItemEntry() const override { return false; }
|
||||||
|
|
||||||
[[nodiscard]] ImVec2 getMinSize() const override { return scaled({ 600, 400 }); }
|
[[nodiscard]] ImVec2 getMinSize() const override { return scaled({ 600, 400 }); }
|
||||||
|
@ -17,10 +17,8 @@
|
|||||||
namespace hex::plugin::builtin {
|
namespace hex::plugin::builtin {
|
||||||
|
|
||||||
ViewAbout::ViewAbout() : View::Modal("hex.builtin.view.help.about.name") {
|
ViewAbout::ViewAbout() : View::Modal("hex.builtin.view.help.about.name") {
|
||||||
|
|
||||||
// Add "About" menu item to the help menu
|
// 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] {
|
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;
|
this->getWindowOpenState() = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ namespace hex::plugin::builtin {
|
|||||||
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.store.name" }, 1000, Shortcut::None, [&, this] {
|
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.view.store.name" }, 1000, Shortcut::None, [&, this] {
|
||||||
if (this->m_requestStatus == RequestStatus::NotAttempted)
|
if (this->m_requestStatus == RequestStatus::NotAttempted)
|
||||||
this->refresh();
|
this->refresh();
|
||||||
TaskManager::doLater([this] { ImGui::OpenPopup(View::toWindowName(this->getUnlocalizedName()).c_str()); });
|
|
||||||
this->getWindowOpenState() = true;
|
this->getWindowOpenState() = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user