summaryrefslogtreecommitdiffstats
path: root/src/fs
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-05-01 12:57:19 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-05-01 12:57:19 -0400
commit171bcbc8565f29696b7a62e96430bf46abfe7217 (patch)
treefa073d179e5c6a1ca64a89109960eac24a0bfdb2 /src/fs
parent4409199315c5cc22bfba6cc63052a49dbdddfeb1 (diff)
move theming out of entry and into utils
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/entry.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/fs/entry.rs b/src/fs/entry.rs
index d2a694b..81c41d1 100644
--- a/src/fs/entry.rs
+++ b/src/fs/entry.rs
@@ -8,7 +8,6 @@ use crate::fs::{FileType, JoshutoMetadata};
use crate::util::devicons::*;
use crate::util::unix;
-use crate::THEME_T;
#[derive(Clone, Debug)]
pub struct JoshutoDirEntry {
@@ -84,16 +83,6 @@ impl JoshutoDirEntry {
self.path.as_path()
}
- /*
- pub fn is_marked(&self) -> bool {
- self.marked
- }
-
- pub fn set_marked(&mut self, marked: bool) {
- self.marked = marked;
- }
- */
-
pub fn is_selected(&self) -> bool {
self.selected
}
@@ -101,40 +90,6 @@ impl JoshutoDirEntry {
pub fn set_selected(&mut self, selected: bool) {
self.selected = selected;
}
-
- pub fn get_style(&self) -> Style {
- let metadata = &self.metadata;
- let filetype = &metadata.file_type();
-
- match filetype {
- _ if self.is_selected() => Style::default()
- .fg(THEME_T.selection.fg)
- .bg(THEME_T.selection.bg)
- .add_modifier(THEME_T.selection.modifier),
- FileType::Directory => Style::default()
- .fg(THEME_T.directory.fg)
- .bg(THEME_T.directory.bg)
- .add_modifier(THEME_T.directory.modifier),
- FileType::Symlink(_) => Style::default()
- .fg(THEME_T.link.fg)
- .bg(THEME_T.link.bg)
- .add_modifier(THEME_T.link.modifier),
- _ if unix::is_executable(metadata.mode) => Style::default()
- .fg(THEME_T.executable.fg)
- .bg(THEME_T.executable.bg)
- .add_modifier(THEME_T.executable.modifier),
- _ => match self.file_path().extension() {
- None => Style::default(),
- Some(os_str) => match os_str.to_str() {
- None => Style::default(),
- Some(s) => match THEME_T.ext.get(s) {
- None => Style::default(),
- Some(t) => Style::default().fg(t.fg).bg(t.bg).add_modifier(t.modifier),
- },
- },
- },
- }
- }
}
impl std::fmt::Display for JoshutoDirEntry {