diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-10 10:12:23 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-10 10:12:23 +0100 |
| commit | d671ea83612bcb683e675c041392922e66e57e58 (patch) | |
| tree | 11ebb222ef8007a53ba175e0994958c2a23e42c7 /src/main.cpp | |
| parent | b84007b0bc5fe286c96c675f5c2c210cccbc0490 (diff) | |
results are collapsable on per file
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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); |
