This commit is contained in:
2025-07-24 00:18:09 +01:00
parent 9c50db2b62
commit c3ae04ab75
7 changed files with 13 additions and 24 deletions
+5 -10
View File
@@ -249,7 +249,7 @@ impl Explorer {
});
})
.body(|ui| {
let mut entries: Vec<_> = WalkDir::new(PROJECT_FOLDER.join("assets"))
let entries: Vec<_> = WalkDir::new(PROJECT_FOLDER.join("assets"))
.min_depth(1)
.max_depth(1) // Only immediate children
.sort_by(|a, b| {
@@ -269,17 +269,12 @@ impl Explorer {
.collect();
for entry in entries {
self.render_entry(ui, to_load, &entry);
Self::render_entry(ui, to_load, &entry);
}
});
}
fn render_entry(
&mut self,
ui: &mut egui::Ui,
to_load: &mut Option<RightPanelContent>,
entry: &DirEntry,
) {
fn render_entry(ui: &mut egui::Ui, to_load: &mut Option<RightPanelContent>, entry: &DirEntry) {
let file_type = entry.file_type();
let is_dir = file_type.is_dir();
let file_name = entry.file_name().to_string_lossy();
@@ -302,13 +297,13 @@ impl Explorer {
.show_header(ui, |ui| {
ui.horizontal(|ui| {
ui.label(file_name);
let clicked = ui.button("+").on_hover_text("Add new item").clicked();
let _clicked = ui.button("+").on_hover_text("Add new item").clicked();
});
})
.body(|ui| {
// recursive call to render the next level of documents
for entry in entries {
self.render_entry(ui, to_load, &entry);
Self::render_entry(ui, to_load, &entry);
}
});
} else {