add field to status bar

This commit is contained in:
i do not exist 2026-09-15 17:43:52 +03:00
parent a7ba45d254
commit 8cb41fe4d8

View file

@ -512,7 +512,7 @@ impl View<Tui, App> {
Some(":device") => draw!(|app|view_device(app)),
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(":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(":transport") => Self::boxed(move|_, to|view_transport(true, "", "", "").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.
pub fn views_add <'a> (views: &Views, expr: impl Language) -> UsuallyRef<'a, ()> {
views.try_write().unwrap().insert(