Before going crazy

This commit is contained in:
2026-01-28 18:05:50 +01:00
parent 4c633a895f
commit db5237480a
11 changed files with 459 additions and 299 deletions

View File

@@ -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
};