1
0
mirror of synced 2024-11-24 07:40:17 +01:00

ui: Fixed sizing of several popups

This commit is contained in:
WerWolv 2022-01-16 00:48:35 +01:00
parent 8a6b110d0b
commit ed8ee35a86
4 changed files with 6 additions and 11 deletions

View File

@ -519,11 +519,7 @@ namespace hex {
continue;
if (view->isAvailable()) {
auto minSize = view->getMinSize();
minSize.x *= SharedData::globalScale;
minSize.y *= SharedData::globalScale;
ImGui::SetNextWindowSizeConstraints(minSize, view->getMaxSize());
ImGui::SetNextWindowSizeConstraints(scaled(view->getMinSize()), scaled(view->getMaxSize()));
view->drawContent();
}

View File

@ -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 ImVec2(400, 100); }
[[nodiscard]] ImVec2 getMaxSize() const override { return ImVec2(400, 100); }
[[nodiscard]] ImVec2 getMinSize() const override { return { 400, 100 }; }
[[nodiscard]] ImVec2 getMaxSize() const override { return { 400, 100 }; }
private:
enum class MatchType {

View File

@ -18,9 +18,8 @@ namespace hex::plugin::builtin {
[[nodiscard]] bool hasViewMenuItemEntry() const override { return false; }
[[nodiscard]] ImVec2 getMinSize() const override {
return scaled(ImVec2(500, 300));
}
[[nodiscard]] ImVec2 getMinSize() const override { return { 500, 300 }; }
[[nodiscard]] ImVec2 getMaxSize() const override { return { 500, 300 }; }
};
}

View File

@ -566,7 +566,7 @@ namespace hex::plugin::builtin {
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Appearing, ImVec2(0.5F, 0.5F));
if (ImGui::BeginPopupModal("hex.builtin.view.pattern_editor.menu.file.load_pattern"_lang, &opened, ImGuiWindowFlags_AlwaysAutoResize)) {
if (ImGui::BeginListBox("##patterns", ImVec2(-FLT_MIN, 0))) {
if (ImGui::BeginListBox("##patterns", ImVec2(300_scaled, 0))) {
u32 index = 0;
for (auto &path : this->m_possiblePatternFiles) {