From f2b6af8bdc3b774e5142cc09b3b278519dee9505 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 7 Jul 2025 11:15:46 +0200 Subject: [PATCH] fix: Duplicate ImGui IDs in data information view --- .../content/data_information_sections.cpp | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/plugins/builtin/source/content/data_information_sections.cpp b/plugins/builtin/source/content/data_information_sections.cpp index 4308c169f..f9795e195 100644 --- a/plugins/builtin/source/content/data_information_sections.cpp +++ b/plugins/builtin/source/content/data_information_sections.cpp @@ -281,28 +281,49 @@ namespace hex::plugin::builtin { ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{}", "hex.builtin.information_section.info_analysis.highest_entropy"_lang); ImGui::TableNextColumn(); - ImGuiExt::TextFormattedSelectable("{:.5f} @", m_highestBlockEntropy); - ImGui::SameLine(); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); - ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::Button(hex::format("0x{:06X}", m_highestBlockEntropyAddress).c_str())) { - ImHexApi::HexEditor::setSelection(m_highestBlockEntropyAddress, m_inputChunkSize); + { + ImGui::PushID("##HighestBlockEntropyValue"); + ImGuiExt::TextFormattedSelectable("{:.5f} @", m_highestBlockEntropy); + ImGui::PopID(); + } + + ImGui::SameLine(); + + { + ImGui::PushID("##HighestBlockEntropyAddress"); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); + if (ImGui::Button(hex::format("0x{:06X}", m_highestBlockEntropyAddress).c_str())) { + ImHexApi::HexEditor::setSelection(m_highestBlockEntropyAddress, m_inputChunkSize); + } + ImGui::PopStyleColor(); + ImGui::PopStyleVar(); + ImGui::PopID(); } - ImGui::PopStyleColor(); - ImGui::PopStyleVar(); ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{}", "hex.builtin.information_section.info_analysis.lowest_entropy"_lang); ImGui::TableNextColumn(); - ImGuiExt::TextFormattedSelectable("{:.5f} @", m_lowestBlockEntropy); - ImGui::SameLine(); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); - ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::Button(hex::format("0x{:06X}", m_lowestBlockEntropyAddress).c_str())) { - ImHexApi::HexEditor::setSelection(m_lowestBlockEntropyAddress, m_inputChunkSize); + + { + ImGui::PushID("##LowestBlockEntropyValue"); + ImGuiExt::TextFormattedSelectable("{:.5f} @", m_lowestBlockEntropy); + ImGui::PopID(); + } + + ImGui::SameLine(); + + { + ImGui::PushID("##LowestBlockEntropyAddress"); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); + if (ImGui::Button(hex::format("0x{:06X}", m_lowestBlockEntropyAddress).c_str())) { + ImHexApi::HexEditor::setSelection(m_lowestBlockEntropyAddress, m_inputChunkSize); + } + ImGui::PopStyleColor(); + ImGui::PopStyleVar(); + ImGui::PopID(); } - ImGui::PopStyleColor(); - ImGui::PopStyleVar(); ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{}", "hex.builtin.information_section.info_analysis.plain_text_percentage"_lang);