git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commit62061adb0fe11d2a64140d8bf28c98238d1b2849
parentd2f2024d5f
authorLucas Galante <[email protected]>
date2026-07-03 17:19
Support collapsing tree sections when search filters are active

 src/widget/container/treelist.rs | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/widget/container/treelist.rs b/src/widget/container/treelist.rs
index 5a4d789..059032c 100644
--- a/src/widget/container/treelist.rs
+++ b/src/widget/container/treelist.rs
@@ -139,11 +139,7 @@ fn build_tree(
             } else {
                 if !seen_prefixes.contains(&current_prefix) {
                     seen_prefixes.insert(current_prefix.clone());
-                    let collapsed = if query.is_empty() {
-                        collapsed_sections.contains(&current_prefix)
-                    } else {
-                        false
-                    };
+                    let collapsed = collapsed_sections.contains(&current_prefix);
                     items.push(TreeElement::Section {
                         path: current_prefix.clone(),
                         name: part_name,
@@ -151,7 +147,7 @@ fn build_tree(
                         collapsed,
                     });
                 }
-                if query.is_empty() && collapsed_sections.contains(&current_prefix) {
+                if collapsed_sections.contains(&current_prefix) {
                     is_hidden = true;
                 }
             }