mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
uuugh
This commit is contained in:
parent
ca862b9802
commit
90fc869e14
42 changed files with 645 additions and 1158 deletions
|
|
@ -28,19 +28,18 @@ impl ExampleCommand {
|
|||
}
|
||||
}
|
||||
|
||||
tui_draw!(|self: Example, to|{
|
||||
to.place(&self.content());
|
||||
});
|
||||
content!(TuiOut: |self: Example|{
|
||||
let index = self.0 + 1;
|
||||
let wh = self.1.wh();
|
||||
let src = Self::VIEWS.get(self.0).unwrap_or(&"");
|
||||
let heading = format!("Example {}/{} in {:?}", index, Self::VIEWS.len(), &wh);
|
||||
let title = Tui::bg(Color::Rgb(60, 10, 10), Push::y(1, Align::n(heading)));
|
||||
let code = Tui::bg(Color::Rgb(10, 60, 10), Push::y(2, Align::n(format!("{}", src))));
|
||||
let content = ();//Tui::bg(Color::Rgb(10, 10, 60), View(self, CstIter::new(src)));
|
||||
self.1.of(Bsp::s(title, Bsp::n(""/*code*/, content)))
|
||||
});
|
||||
impl Draw<TuiOut> for Example {
|
||||
fn content (&self) -> impl Draw<TuiOut> {
|
||||
let index = self.0 + 1;
|
||||
let wh = self.1.wh();
|
||||
let src = Self::VIEWS.get(self.0).unwrap_or(&"");
|
||||
let heading = format!("Example {}/{} in {:?}", index, Self::VIEWS.len(), &wh);
|
||||
let title = Tui::bg(Color::Rgb(60, 10, 10), Push::y(1, Align::n(heading)));
|
||||
let code = Tui::bg(Color::Rgb(10, 60, 10), Push::y(2, Align::n(format!("{}", src))));
|
||||
let content = ();//Tui::bg(Color::Rgb(10, 10, 60), View(self, CstIter::new(src)));
|
||||
self.1.of(Bsp::s(title, Bsp::n(""/*code*/, content)))
|
||||
}
|
||||
}
|
||||
impl View<TuiOut, ()> for Example {
|
||||
fn view_expr <'a> (&'a self, to: &mut TuiOut, expr: &'a impl DslExpr) -> Usually<()> {
|
||||
if evaluate_output_expression(self, to, expr)?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue