From e32c5784af1027a66f24e5fe47c53c9e65fd4a24 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 16 May 2025 20:24:38 +0200 Subject: [PATCH] impr: Further refine pattern tree indenting --- plugins/ui/source/ui/pattern_drawer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/ui/source/ui/pattern_drawer.cpp b/plugins/ui/source/ui/pattern_drawer.cpp index 57c24bae7..219d70d8f 100644 --- a/plugins/ui/source/ui/pattern_drawer.cpp +++ b/plugins/ui/source/ui/pattern_drawer.cpp @@ -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();