add edit modes

This commit is contained in:
🪞👃🪞 2025-03-24 03:37:36 +02:00
parent 06b4efd70e
commit 870bf249d8
4 changed files with 53 additions and 30 deletions

View file

@ -34,13 +34,14 @@ impl Content<TuiOut> for Taggart {
Color::Rgb(0, 0, 0),
Color::Rgb(192, 192, 192),
Fill::x(Bsp::a(
Fill::x(Align::w(Tui::bold(true, if self.editing.is_some() {
Bsp::e(
Tui::bg(Self::BG_EDIT, Tui::fg(Self::FG_EDIT, " EDIT ")),
" Esc: cancel, Enter: set value"
)
} else {
Bsp::e(
Fill::x(Align::w(Tui::bold(true, match self.mode {
Some(Mode::Edit { .. }) => {
Bsp::e(
Tui::bg(Self::BG_EDIT, Tui::fg(Self::FG_EDIT, " EDIT ")),
" Esc: cancel, Enter: set value"
)
},
_ => Bsp::e(
Tui::bg(Self::BG_BROWSE, Tui::fg(Self::FG_BROWSE, " BROWSE ")),
" Q: exit, Arrows: select, Space: open, Enter: edit"
)