exit key and quickhelp

This commit is contained in:
🪞👃🪞 2025-03-23 00:18:08 +02:00
parent 26d05e544b
commit d443ccfc96
2 changed files with 9 additions and 2 deletions

View file

@ -27,6 +27,7 @@ impl Handle<TuiIn> for Taggart {
let event = &*input.event();
match &self.editing {
None => match event {
press!(Char('q')) => { input.done() },
press!(Up) => { self.cursor = self.cursor.saturating_sub(1); },
press!(Down) => { self.cursor = self.cursor + 1; },
press!(PageUp) => { self.cursor = self.cursor.saturating_sub(PAGE_SIZE); },

View file

@ -19,9 +19,15 @@ impl Content<TuiOut> for Taggart {
let titlebar = status_bar(Align::w(self.columns.header()));
let size_bar = status_bar(Fill::x(Bsp::a(
Fill::x(Align::w(Tui::bold(true, if self.editing.is_some() {
Tui::bg(Self::BG_EDIT, Tui::fg(Self::FG_EDIT, " EDIT "))
Bsp::e(
Tui::bg(Self::BG_EDIT, Tui::fg(Self::FG_EDIT, " EDIT ")),
" Esc to cancel, Enter to save"
)
} else {
Tui::bg(Self::BG_BROWSE, Tui::fg(Self::FG_BROWSE, " BROWSE "))
Bsp::e(
Tui::bg(Self::BG_BROWSE, Tui::fg(Self::FG_BROWSE, " BROWSE ")),
" Q to exit, Arrows to select, Enter to edit"
)
}))),
Fill::x(Align::e(size)),
)));