diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_dynamic.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_dynamic.hpp index 65ec864ea..23457c50c 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_dynamic.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_dynamic.hpp @@ -59,6 +59,9 @@ namespace hex::pl { ImGui::TableNextColumn(); ImGui::TextFormatted("{}", this->formatDisplayValue("{ ... }", this)); + } else { + ImGui::SameLine(); + ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf); } if (open) { @@ -77,8 +80,7 @@ namespace hex::pl { } } - if (!this->isInlined()) - ImGui::TreePop(); + ImGui::TreePop(); } else { this->m_displayEnd = 50; } diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp index de3270221..5d0f8a78d 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_array_static.hpp @@ -50,6 +50,9 @@ namespace hex::pl { ImGui::TableNextColumn(); ImGui::TextFormatted("{}", this->formatDisplayValue("{ ... }", this)); + } else { + ImGui::SameLine(); + ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf); } if (open) { @@ -72,8 +75,7 @@ namespace hex::pl { } } - if (!this->isInlined()) - ImGui::TreePop(); + ImGui::TreePop(); } else { this->m_displayEnd = 50; } 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 8f5d6f0a7..8a5809c23 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_bitfield.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_bitfield.hpp @@ -121,6 +121,9 @@ namespace hex::pl { valueString += "}"; ImGui::TextFormatted("{}", this->formatDisplayValue(valueString, this)); + } else { + ImGui::SameLine(); + ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf); } if (open) { @@ -128,9 +131,9 @@ namespace hex::pl { for (auto &field : this->m_fields) field->draw(provider); - if (!this->isInlined()) - ImGui::TreePop(); + ImGui::TreePop(); } + } void setOffset(u64 offset) override { diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp index 28a4698e5..4213d1474 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp @@ -45,13 +45,15 @@ namespace hex::pl { ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{}", this->getFormattedName()); ImGui::TableNextColumn(); ImGui::TextFormatted("{}", formatDisplayValue(hex::format("*(0x{0:X})", data), u128(data))); + } else { + ImGui::SameLine(); + ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf); } if (open) { this->m_pointedAt->createEntry(provider); - if (!this->isInlined()) - ImGui::TreePop(); + ImGui::TreePop(); } } diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_struct.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_struct.hpp index bcc8df277..53cbb03a6 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_struct.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_struct.hpp @@ -46,14 +46,16 @@ namespace hex::pl { ImGui::TextUnformatted(this->getTypeName().c_str()); ImGui::TableNextColumn(); ImGui::TextFormatted("{}", this->formatDisplayValue("{ ... }", this)); + } else { + ImGui::SameLine(); + ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf); } if (open) { for (auto &member : this->m_sortedMembers) member->draw(provider); - if (!this->isInlined()) - ImGui::TreePop(); + ImGui::TreePop(); } } diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_union.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_union.hpp index f2d0e29b7..dc2b10c7c 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_union.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_union.hpp @@ -47,14 +47,16 @@ namespace hex::pl { ImGui::TableNextColumn(); ImGui::TextFormatted("{}", this->formatDisplayValue("{ ... }", this)); + } else { + ImGui::SameLine(); + ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf); } if (open) { for (auto &member : this->m_sortedMembers) member->draw(provider); - if (!this->isInlined()) - ImGui::TreePop(); + ImGui::TreePop(); } }