wip: general overhaul of core and ports
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-05-20 22:05:09 +03:00
parent 573534a9a6
commit 447638ee71
30 changed files with 824 additions and 548 deletions

View file

@ -1,19 +1,24 @@
use crate::*;
content!(TuiOut: |self: Dialog| match self {
Self::Menu(_) =>
self.view_dialog_menu().boxed(),
Self::Help(offset) =>
self.view_dialog_help(*offset).boxed(),
Self::Browser(target, browser) =>
self.view_dialog_browser(target, browser).boxed(),
Self::Options =>
self.view_dialog_options().boxed(),
Self::Device(index) =>
self.view_dialog_device(*index).boxed(),
Self::Message(message) =>
self.view_dialog_message(message).boxed(),
});
impl Content<TuiOut> for Dialog {
fn content (&self) -> impl Render<TuiOut> + '_ {
Some(match self {
Self::Menu(_) => self.view_dialog_menu().boxed(),
_ => "kyp".boxed()
})
//Self::Help(offset) =>
//self.view_dialog_help(*offset).boxed(),
//Self::Browser(target, browser) =>
//self.view_dialog_browser(target, browser).boxed(),
//Self::Options =>
//self.view_dialog_options().boxed(),
//Self::Device(index) =>
//self.view_dialog_device(*index).boxed(),
//Self::Message(message) =>
//self.view_dialog_message(message).boxed(),
//})
}
}
content!(TuiOut: |self: Message| match self {
Self::FailedToAddDevice => "Failed to add device."
@ -25,7 +30,7 @@ impl Dialog {
let option = |a,i|Tui::fg(Rgb(255,255,255), format!("{}", a));
Bsp::s(Tui::bold(true, "tek!"), Bsp::s("", Map::south(1, options, option)))
}
pub fn view_dialog_help <'a> (&'a self, offset: usize) -> impl Content<TuiOut> + use<'a> {
pub fn view_dialog_help <'a> (&'a self, offset: usize) -> impl Content<TuiOut> + 'a {
Bsp::s(Tui::bold(true, "Help"), "FIXME")
//Bsp::s(Tui::bold(true, "Help"), Bsp::s("", Map::south(1,
//move||self.config.keys.layers.iter()