mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 09:36:42 +01:00
exit key and quickhelp
This commit is contained in:
parent
26d05e544b
commit
d443ccfc96
2 changed files with 9 additions and 2 deletions
|
|
@ -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); },
|
||||
|
|
|
|||
10
src/view.rs
10
src/view.rs
|
|
@ -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)),
|
||||
)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue