mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-09-18 12:56:42 +02:00
add field to status bar
This commit is contained in:
parent
a7ba45d254
commit
8cb41fe4d8
1 changed files with 5 additions and 1 deletions
|
|
@ -512,7 +512,7 @@ impl View<Tui, App> {
|
||||||
Some(":device") => draw!(|app|view_device(app)),
|
Some(":device") => draw!(|app|view_device(app)),
|
||||||
Some(":dialog") => Self::boxed(move|state, to|draw_dialog(to, word.split("/").skip(1), state)),
|
Some(":dialog") => Self::boxed(move|state, to|draw_dialog(to, word.split("/").skip(1), state)),
|
||||||
Some(":sessions") => Self::boxed(move|_, to|view_sessions().draw(to)),
|
Some(":sessions") => Self::boxed(move|_, to|view_sessions().draw(to)),
|
||||||
Some(":status") => Self::boxed(move|_, to|"TODO: Status Bar".draw(to)),
|
Some(":status") => Self::boxed(move|state, to|draw_status_bar(to, state)),
|
||||||
Some(":editor") => Self::boxed(move|_, to|"TODO Editor".draw(to)),
|
Some(":editor") => Self::boxed(move|_, to|"TODO Editor".draw(to)),
|
||||||
Some(":transport") => Self::boxed(move|_, to|view_transport(true, "", "", "").draw(to)),
|
Some(":transport") => Self::boxed(move|_, to|view_transport(true, "", "", "").draw(to)),
|
||||||
Some(":debug") => Self::boxed(move|_, to|format!("[{:?}]", to.area()).exact_h(1).draw(to)),
|
Some(":debug") => Self::boxed(move|_, to|format!("[{:?}]", to.area()).exact_h(1).draw(to)),
|
||||||
|
|
@ -526,6 +526,10 @@ impl View<Tui, App> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn draw_status_bar (to: &mut Tui, state: &App) -> Drawn<u16> {
|
||||||
|
bar(Split::South, 1u16, dim(true, "Mode"), bold(true, &state.mode)).push_x(1).draw(to)
|
||||||
|
}
|
||||||
|
|
||||||
/// Load custom view definition.
|
/// Load custom view definition.
|
||||||
pub fn views_add <'a> (views: &Views, expr: impl Language) -> UsuallyRef<'a, ()> {
|
pub fn views_add <'a> (views: &Views, expr: impl Language) -> UsuallyRef<'a, ()> {
|
||||||
views.try_write().unwrap().insert(
|
views.try_write().unwrap().insert(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue