From caf8fa8e25b7d594ebe94080303b4bc7e126ab10 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 15 Dec 2024 11:46:54 +0100 Subject: [PATCH] impr: Show byte relationship diagrams side by side if there's enough space --- .../content/data_information_sections.cpp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/builtin/source/content/data_information_sections.cpp b/plugins/builtin/source/content/data_information_sections.cpp index 11fc96320..ce1d1b8a3 100644 --- a/plugins/builtin/source/content/data_information_sections.cpp +++ b/plugins/builtin/source/content/data_information_sections.cpp @@ -418,11 +418,31 @@ class InformationByteRelationshipAnalysis : public ContentRegistry::DataInformat void drawContent() override { auto availableWidth = ImGui::GetContentRegionAvail().x; - ImGui::TextUnformatted("hex.builtin.information_section.relationship_analysis.digram"_lang); - m_digram.draw({ availableWidth, availableWidth }); + if (availableWidth > 750_scaled) { + availableWidth /= 2; + availableWidth -= ImGui::GetStyle().FramePadding.x; - ImGui::TextUnformatted("hex.builtin.information_section.relationship_analysis.layered_distribution"_lang); - m_layeredDistribution.draw({ availableWidth, availableWidth }); + if (ImGui::BeginTable("##RelationshipTable", 2)) { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + + ImGui::TextUnformatted("hex.builtin.information_section.relationship_analysis.digram"_lang); + m_digram.draw({ availableWidth, availableWidth }); + + ImGui::TableNextColumn(); + + ImGui::TextUnformatted("hex.builtin.information_section.relationship_analysis.layered_distribution"_lang); + m_layeredDistribution.draw({ availableWidth, availableWidth }); + + ImGui::EndTable(); + } + } else { + ImGui::TextUnformatted("hex.builtin.information_section.relationship_analysis.digram"_lang); + m_digram.draw({ availableWidth, availableWidth }); + + ImGui::TextUnformatted("hex.builtin.information_section.relationship_analysis.layered_distribution"_lang); + m_layeredDistribution.draw({ availableWidth, availableWidth }); + } } void load(const nlohmann::json &data) override {