impr: Further refine pattern tree indenting

This commit is contained in:
WerWolv
2025-05-16 20:24:38 +02:00
parent 1496a6e755
commit e32c5784af

View File

@@ -445,11 +445,12 @@ namespace hex::ui {
ImGui::TableNextColumn();
if (pattern.isSealed() || leaf) {
ImGui::Indent(ImGui::GetCurrentContext()->FontSize + ImGui::GetStyle().FramePadding.x * 2);
const float indent = ImGui::GetCurrentContext()->FontSize + ImGui::GetStyle().FramePadding.x * 2;
ImGui::Indent(indent);
highlightWhenSelected(pattern, [&] {
ImGui::TextUnformatted(this->getDisplayName(pattern).c_str());
});
ImGui::Unindent(ImGui::GetCurrentContext()->FontSize + ImGui::GetStyle().FramePadding.x * 2);
ImGui::Unindent(indent);
return false;
}
@@ -1320,6 +1321,7 @@ namespace hex::ui {
if (beginPatternTable(patterns, m_sortedPatterns, height)) {
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImGui::GetColorU32(ImGuiCol_HeaderHovered, 0.4F));
ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImGui::GetColorU32(ImGuiCol_HeaderActive, 0.4F));
ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, ImGui::CalcTextSize(" ").x * 2);
ImGui::TableHeadersRow();
m_showFavoriteStars = false;
@@ -1390,6 +1392,7 @@ namespace hex::ui {
}
}
ImGui::PopStyleVar();
ImGui::PopStyleColor(2);
ImGui::EndTable();