wip: refactor(output): simplify layout traits
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
same mf who else 2026-02-04 19:46:54 +02:00
parent f3fcf663a8
commit 501782f8fe
18 changed files with 841 additions and 908 deletions

View file

@ -1,5 +1,13 @@
#![feature(type_changing_struct_update, trait_alias)]
pub use ::{tengri_input, tengri_output, ratatui, crossterm, palette, better_panic};
pub use ::{
dizzle,
tengri_input,
tengri_output,
ratatui,
crossterm,
palette,
better_panic,
};
pub(crate) use ::{
dizzle::*,
tengri_input::*,
@ -23,13 +31,23 @@ pub(crate) use ::{
};
mod tui_engine; pub use self::tui_engine::*;
mod tui_content; pub use self::tui_content::*;
#[macro_export] macro_rules! tui_main {
($expr:expr) => {
fn main () -> Usually<()> {
let state = Arc::new(RwLock::new($expr));
tengri_tui::Tui::new().unwrap().run(&state)?;
Ok(())
}
};
}
#[cfg(test)] mod tui_test {
use crate::*;
#[test] fn test_tui_engine () -> Usually<()> {
//use std::sync::{Arc, RwLock};
struct TestComponent(String);
impl Content<TuiOut> for TestComponent {
fn content (&self) -> impl Draw<TuiOut> {
impl HasContent<TuiOut> for TestComponent {
fn content (&self) -> impl Content<TuiOut> {
Some(self.0.as_str())
}
}