Skip to content

Commit

Permalink
patterns: Fixed indentation of inlined variables
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Mar 17, 2022
1 parent a17b647 commit 11441d6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -77,8 +80,7 @@ namespace hex::pl {
}
}

if (!this->isInlined())
ImGui::TreePop();
ImGui::TreePop();
} else {
this->m_displayEnd = 50;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -72,8 +75,7 @@ namespace hex::pl {
}
}

if (!this->isInlined())
ImGui::TreePop();
ImGui::TreePop();
} else {
this->m_displayEnd = 50;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,19 @@ namespace hex::pl {
valueString += "}";

ImGui::TextFormatted("{}", this->formatDisplayValue(valueString, this));
} else {
ImGui::SameLine();
ImGui::TreeNodeEx("", ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_Leaf);
}

if (open) {

for (auto &field : this->m_fields)
field->draw(provider);

if (!this->isInlined())
ImGui::TreePop();
ImGui::TreePop();
}

}

void setOffset(u64 offset) override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 11441d6

Please sign in to comment.