show main menu
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-08-03 21:23:08 +03:00
parent e9f912f4d9
commit f488811767
3 changed files with 39 additions and 22 deletions

View file

@ -38,16 +38,19 @@ impl App {
"nil"
}
pub fn view_menu (&self) -> impl Content<TuiOut> + use<'_> {
Stack::south(|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
add(&Tui::bold(true, "tek 0.3.0-rc0"));
add(&"");
for (name, _) in self.configs.profiles.read().unwrap().iter() {
add(&"");
add(&name);
}
add(&"");
add(&"+ new session");
})
Bsp::s(Fill::x(Fixed::y(3, Tui::bg(Rgb(33,33,33), Tui::bold(true, "tek 0.3.0-rc0")))),
Bsp::n(Fill::x(Fixed::y(3, Tui::bg(Rgb(33,33,33), "+ new session"))),
Fill::xy(Stack::south(|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
for (index, (id, profile)) in self.configs.profiles.read().unwrap().iter().enumerate() {
add(&Fixed::y(3, Tui::bg(if index == 0 { Rgb(64,64,64) } else { Rgb(32,32,32) }, Bsp::s(
Fill::x(Bsp::a(
Fill::x(Align::w(Tui::fg(Rgb(224,192,128), &profile.name))),
Fill::x(Align::e(Tui::fg(Rgb(224,128,32), id)))
)),
Fill::x(Align::w(&profile.info))
))));
}
}))))
}
pub fn view_dialog (&self) -> impl Content<TuiOut> + use<'_> {
self.dialog.as_ref().map(|dialog|Bsp::b("",