device picker
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-05-04 16:23:50 +03:00
parent 55b6745d4d
commit a77536c234
6 changed files with 93 additions and 13 deletions

View file

@ -70,6 +70,7 @@ impl Tek {
.enclose(self.modal.map(|modal|match modal {
Modal::Menu => self.view_modal_menu().boxed(),
Modal::Help => self.view_modal_help().boxed(),
Modal::Device(index) => self.view_modal_device(index).boxed(),
}))
)))
))
@ -109,6 +110,16 @@ impl Tek {
Bsp::s(Tui::bold(true, "Help"), Bsp::s("", Map::south(1, bindings, binding)))
}
fn view_modal_device (&self, index: usize) -> impl Content<TuiOut> + use<'_> {
let choices = ||self.device_kinds().iter();
let choice = move|label, i|
Fill::x(Tui::bg(if i == index { Rgb(64,128,32) } else { Rgb(0,0,0) },
Bsp::e(if i == index { "[ " } else { " " },
Bsp::w(if i == index { " ]" } else { " " },
label))));
Bsp::s(Tui::bold(true, "Add device"), Map::south(1, choices, choice))
}
/// Spacing between tracks.
pub(crate) const TRACK_SPACING: usize = 0;