From d671ea83612bcb683e675c041392922e66e57e58 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 10 Mar 2024 10:12:23 +0100 Subject: results are collapsable on per file --- src/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 5857192..32aca84 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -246,7 +246,17 @@ void _ts_create_text_match_rows() { ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::TableHeader(""); + + ImGui::SetCursorPosX(5); + ImGui::PushStyleColor(ImGuiCol_Text, {0,0,0,0.1f}); + ImGui::TableHeader(file->file->collapsed ? "▶" : "▼"); + + ImGui::SameLine(); + ImGui::Selectable("##nolabel", false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap); + if (ImGui::IsItemClicked(ImGuiPopupFlags_MouseButtonLeft)) { + file->file->collapsed = !file->file->collapsed; + } + ImGui::PopStyleColor(); ImGui::TableNextColumn(); ImGui::TableHeader(file->file->path); @@ -256,6 +266,8 @@ void _ts_create_text_match_rows() { ImGui::TableHeader(match_info_txt); } + if (file->file->collapsed) continue; + char match_nr[20]; snprintf(match_nr, 20, "#%d", item+1); -- cgit v1.2.3-70-g09d2