From 7061a1ebfa108d9d889d3a9da6761c81472bf4af Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 17 Mar 2022 23:31:36 +0100 Subject: [PATCH] patterns: Allow bitfield fields to be selected --- .../hex/pattern_language/patterns/pattern_bitfield.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_bitfield.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_bitfield.hpp index 8a5809c23..71050d22e 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_bitfield.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_bitfield.hpp @@ -24,6 +24,10 @@ namespace hex::pl { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::TextUnformatted(this->getDisplayName().c_str()); + ImGui::SameLine(); + if (ImGui::Selectable(("##PatternLine"s + std::to_string(u64(this))).c_str(), false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap)) { + ImHexApi::HexEditor::setSelection(this->getOffset(), this->getSize()); + } ImGui::TableNextColumn(); ImGui::ColorButton("color", ImColor(this->getColor()), ImGuiColorEditFlags_NoTooltip, ImVec2(ImGui::GetColumnWidth(), ImGui::GetTextLineHeight())); ImGui::TableNextColumn();