mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Show byte relationship diagrams side by side if there's enough space
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user