Before going crazy
This commit is contained in:
@@ -9,7 +9,7 @@ use super::ModalFrame;
|
||||
pub struct FileBrowserModal<'a> {
|
||||
title: &'a str,
|
||||
input: &'a str,
|
||||
entries: &'a [(String, bool)],
|
||||
entries: &'a [(String, bool, bool)],
|
||||
selected: usize,
|
||||
scroll_offset: usize,
|
||||
border_color: Color,
|
||||
@@ -18,7 +18,7 @@ pub struct FileBrowserModal<'a> {
|
||||
}
|
||||
|
||||
impl<'a> FileBrowserModal<'a> {
|
||||
pub fn new(title: &'a str, input: &'a str, entries: &'a [(String, bool)]) -> Self {
|
||||
pub fn new(title: &'a str, input: &'a str, entries: &'a [(String, bool, bool)]) -> Self {
|
||||
Self {
|
||||
title,
|
||||
input,
|
||||
@@ -85,7 +85,7 @@ impl<'a> FileBrowserModal<'a> {
|
||||
|
||||
let lines: Vec<Line> = visible_entries
|
||||
.enumerate()
|
||||
.map(|(i, (name, is_dir))| {
|
||||
.map(|(i, (name, is_dir, is_cagire))| {
|
||||
let abs_idx = i + self.scroll_offset;
|
||||
let is_selected = abs_idx == self.selected;
|
||||
let prefix = if is_selected { "> " } else { " " };
|
||||
@@ -98,6 +98,8 @@ impl<'a> FileBrowserModal<'a> {
|
||||
Color::Yellow
|
||||
} else if *is_dir {
|
||||
Color::Blue
|
||||
} else if *is_cagire {
|
||||
Color::Magenta
|
||||
} else {
|
||||
Color::White
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user