fix: Prevent constants view from growing past the size of the screen
Fixes #1025
This commit is contained in:
parent
e7494be5e7
commit
349b5da810
@ -619,7 +619,7 @@ namespace hex {
|
||||
|
||||
// Draw view
|
||||
if (view->isAvailable()) {
|
||||
ImGui::SetNextWindowSizeConstraints(scaled(view->getMinSize()), scaled(view->getMaxSize()));
|
||||
ImGui::SetNextWindowSizeConstraints(view->getMinSize(), view->getMaxSize());
|
||||
view->drawContent();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace hex::plugin::builtin {
|
||||
[[nodiscard]] bool hasViewMenuItemEntry() const override { return false; }
|
||||
|
||||
[[nodiscard]] ImVec2 getMinSize() const override {
|
||||
return { 400, 300 };
|
||||
return scaled({ 400, 300 });
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -22,8 +22,8 @@ namespace hex::plugin::builtin {
|
||||
[[nodiscard]] bool shouldProcess() const override { return true; }
|
||||
|
||||
[[nodiscard]] bool hasViewMenuItemEntry() const override { return false; }
|
||||
[[nodiscard]] ImVec2 getMinSize() const override { return { 400, 100 }; }
|
||||
[[nodiscard]] ImVec2 getMaxSize() const override { return { 400, 100 }; }
|
||||
[[nodiscard]] ImVec2 getMinSize() const override { return scaled({ 400, 100 }); }
|
||||
[[nodiscard]] ImVec2 getMaxSize() const override { return scaled({ 400, 100 }); }
|
||||
|
||||
private:
|
||||
enum class MatchType
|
||||
|
@ -28,6 +28,14 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void drawContent() override;
|
||||
|
||||
ImVec2 getMinSize() const override {
|
||||
return scaled(ImVec2(300, 400));
|
||||
}
|
||||
|
||||
ImVec2 getMaxSize() const override {
|
||||
return { FLT_MAX, 800_scaled };
|
||||
}
|
||||
|
||||
private:
|
||||
void reloadConstants();
|
||||
|
||||
|
@ -17,8 +17,8 @@ namespace hex::plugin::builtin {
|
||||
[[nodiscard]] bool isAvailable() const override { return true; }
|
||||
[[nodiscard]] bool hasViewMenuItemEntry() const override { return false; }
|
||||
|
||||
[[nodiscard]] ImVec2 getMinSize() const override { return { 700, 400 }; }
|
||||
[[nodiscard]] ImVec2 getMaxSize() const override { return { 700, 400 }; }
|
||||
[[nodiscard]] ImVec2 getMinSize() const override { return scaled({ 700, 400 }); }
|
||||
[[nodiscard]] ImVec2 getMaxSize() const override { return scaled({ 700, 400 }); }
|
||||
|
||||
private:
|
||||
bool m_restartRequested = false;
|
||||
|
@ -44,8 +44,8 @@ namespace hex::plugin::builtin {
|
||||
[[nodiscard]] bool isAvailable() const override { return true; }
|
||||
[[nodiscard]] bool hasViewMenuItemEntry() const override { return false; }
|
||||
|
||||
[[nodiscard]] ImVec2 getMinSize() const override { return { 600, 400 }; }
|
||||
[[nodiscard]] ImVec2 getMaxSize() const override { return { 900, 700 }; }
|
||||
[[nodiscard]] ImVec2 getMinSize() const override { return scaled({ 600, 400 }); }
|
||||
[[nodiscard]] ImVec2 getMaxSize() const override { return scaled({ 900, 700 }); }
|
||||
|
||||
private:
|
||||
HttpRequest m_httpRequest = HttpRequest("GET", "");
|
||||
|
@ -66,6 +66,7 @@ namespace hex::plugin::builtin {
|
||||
void ViewConstants::drawContent() {
|
||||
if (ImGui::Begin(View::toWindowName("hex.builtin.view.constants.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse)) {
|
||||
|
||||
ImGui::PushItemWidth(-1);
|
||||
ImGui::InputText(
|
||||
"##search", this->m_filter.data(), this->m_filter.capacity(), ImGuiInputTextFlags_CallbackEdit, [](ImGuiInputTextCallbackData *data) {
|
||||
auto &view = *static_cast<ViewConstants *>(data->UserData);
|
||||
@ -84,6 +85,7 @@ namespace hex::plugin::builtin {
|
||||
return 0;
|
||||
},
|
||||
this);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (ImGui::BeginTable("##strings", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_ScrollY)) {
|
||||
ImGui::TableSetupScrollFreeze(0, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user