mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-01-12 02:56:42 +01:00
parent
ca862b9802
commit
3ebdf9e71f
38 changed files with 602 additions and 1108 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