fix: Provider loader interface being closable and not resizing correctly
This commit is contained in:
parent
7ad7ea061c
commit
f2a795c51e
@ -167,13 +167,12 @@ namespace hex {
|
|||||||
|
|
||||||
void draw() final {
|
void draw() final {
|
||||||
if (this->shouldDraw()) {
|
if (this->shouldDraw()) {
|
||||||
ImGui::SetNextWindowSizeConstraints(this->getMinSize(), this->getMaxSize());
|
|
||||||
|
|
||||||
if (this->getWindowOpenState())
|
if (this->getWindowOpenState())
|
||||||
ImGui::OpenPopup(View::toWindowName(this->getUnlocalizedName()).c_str());
|
ImGui::OpenPopup(View::toWindowName(this->getUnlocalizedName()).c_str());
|
||||||
|
|
||||||
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Appearing, ImVec2(0.5F, 0.5F));
|
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())) {
|
ImGui::SetNextWindowSizeConstraints(this->getMinSize(), this->getMaxSize());
|
||||||
|
if (ImGui::BeginPopupModal(View::toWindowName(this->getUnlocalizedName()).c_str(), this->hasCloseButton() ? &this->getWindowOpenState() : nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | this->getWindowFlags())) {
|
||||||
this->drawContent();
|
this->drawContent();
|
||||||
|
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
@ -183,6 +182,8 @@ namespace hex {
|
|||||||
this->getWindowOpenState() = false;
|
this->getWindowOpenState() = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool hasCloseButton() const { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -14,6 +14,13 @@ namespace hex::plugin::builtin {
|
|||||||
[[nodiscard]] bool hasViewMenuItemEntry() const override;
|
[[nodiscard]] bool hasViewMenuItemEntry() const override;
|
||||||
|
|
||||||
[[nodiscard]] bool shouldDraw() const override { return true; }
|
[[nodiscard]] bool shouldDraw() const override { return true; }
|
||||||
|
|
||||||
|
ImVec2 getMinSize() const override { return { -1, -1 }; }
|
||||||
|
ImVec2 getMaxSize() const override { return this->getMinSize(); }
|
||||||
|
|
||||||
|
bool hasCloseButton() const override {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -70,11 +70,6 @@ Pos=1233,38
|
|||||||
Size=687,1021
|
Size=687,1021
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][###hex.builtin.view.provider_settings.name]
|
|
||||||
Pos=822,38
|
|
||||||
Size=637,720
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][###hex.builtin.view.provider_settings.load_popup]
|
[Window][###hex.builtin.view.provider_settings.load_popup]
|
||||||
Pos=585,322
|
Pos=585,322
|
||||||
Size=314,208
|
Size=314,208
|
||||||
|
@ -70,11 +70,6 @@ Pos=1233,38
|
|||||||
Size=687,1021
|
Size=687,1021
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][###hex.builtin.view.provider_settings.name]
|
|
||||||
Pos=822,38
|
|
||||||
Size=637,720
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][###hex.builtin.view.provider_settings.load_popup]
|
[Window][###hex.builtin.view.provider_settings.load_popup]
|
||||||
Pos=585,322
|
Pos=585,322
|
||||||
Size=314,208
|
Size=314,208
|
||||||
|
Loading…
x
Reference in New Issue
Block a user