diff --git a/src/core/ui.rs b/src/core/ui.rs index 131e290..2e37fc3 100644 --- a/src/core/ui.rs +++ b/src/core/ui.rs @@ -63,6 +63,8 @@ impl Calcifer { ui.label("Bookshelf "); }); ui.separator(); + ui.label(format!("{} files displayed", self.n_file_displayed)); + ui.separator(); egui::ScrollArea::vertical().show(ui, |ui| { if let Some(file_tree) = self.file_tree.clone() { let update_requested = self.list_files(ui, &file_tree, &mut n_files); @@ -75,10 +77,10 @@ impl Calcifer { } else { ui.label("No book on the Bookshelf"); } + ui.separator(); }); - ui.separator(); - ui.label(format!("{} files displayed", n_files)); }); + self.n_file_displayed = n_files.clone(); } pub fn draw_bottom_tray(&mut self, ctx: &egui::Context) { diff --git a/src/main.rs b/src/main.rs index 6ad1558..b918756 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,10 +18,10 @@ const TITLE: &str = " debug"; #[cfg(not(debug_assertions))] const TITLE: &str = ""; -const ALLOWED_FILE_EXTENSIONS: [&str; 6] = ["", "rs", "toml", "txt", "project", "sh"]; +const ALLOWED_FILE_EXTENSIONS: [&str; 7] = ["", "rs", "toml", "txt", "project", "sh", "md"]; const PROJECT_EXTENSION: &str = "project"; const TERMINAL_HEIGHT: f32 = 200.0; -const TERMINAL_RANGE: Range = 100.0..500.0; +const TERMINAL_RANGE: Range = 100.0..600.0; const RED: egui::Color32 = egui::Color32::from_rgb(235, 108, 99); const TIME_LABELS: [&str; 7] = [ "input", "settings", "tree", "terminal", "tabs", "content", "windows", @@ -72,6 +72,7 @@ struct Calcifer { home: PathBuf, tree_dir_opened: Vec, file_tree: Option, + n_file_displayed: usize, tree_visible: bool, profiler_visible: bool, @@ -107,6 +108,7 @@ impl Default for Calcifer { home: get_my_home().unwrap().unwrap(), tree_dir_opened: vec![], file_tree: None, + n_file_displayed: 0, tree_visible: false, profiler_visible: false,