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 {
|
||||
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();
|
||||
|
||||
|
@ -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 }); }
|
||||
|
@ -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;
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user