diff options
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/entry.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fs/entry.rs b/src/fs/entry.rs index 4cf3ead..36788cf 100644 --- a/src/fs/entry.rs +++ b/src/fs/entry.rs @@ -1,5 +1,8 @@ use std::{fs, path}; +use tui::style::{Color, Style}; +use tui::widgets::Text; + use crate::fs::JoshutoMetadata; #[derive(Clone, Debug)] @@ -60,6 +63,23 @@ impl JoshutoDirEntry { pub fn set_selected(&mut self, selected: bool) { self.selected = selected; } + + pub fn get_fg_color(&self) -> Color { + let metadata = &self.metadata; + let filetype = metadata.file_type; + + if filetype.is_dir() { + Color::LightBlue + } else if filetype.is_symlink() { + Color::Cyan + } else { + Color::White + } + } + + pub fn get_bg_color(&self) -> Color { + Color::Reset + } } impl std::fmt::Display for JoshutoDirEntry { |