mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 17:46:42 +01:00
add edit modes
This commit is contained in:
parent
06b4efd70e
commit
870bf249d8
4 changed files with 53 additions and 30 deletions
15
src/view.rs
15
src/view.rs
|
|
@ -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"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue