mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
This commit is contained in:
parent
21832453d9
commit
17506726cb
36 changed files with 280 additions and 271 deletions
1
tui/examples/edn/edn01.edn
Normal file
1
tui/examples/edn/edn01.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
:hello-world
|
||||
1
tui/examples/edn/edn02.edn
Normal file
1
tui/examples/edn/edn02.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(bsp/s :hello :world)
|
||||
1
tui/examples/edn/edn03.edn
Normal file
1
tui/examples/edn/edn03.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(fill/xy :hello-world)
|
||||
1
tui/examples/edn/edn04.edn
Normal file
1
tui/examples/edn/edn04.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(fixed/xy 20 10 :hello-world)
|
||||
1
tui/examples/edn/edn05.edn
Normal file
1
tui/examples/edn/edn05.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(bsp/s (fixed/xy 5 6 :hello) (fixed/xy 7 8 :world))
|
||||
1
tui/examples/edn/edn06.edn
Normal file
1
tui/examples/edn/edn06.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(bsp/e (fixed/xy 5 6 :hello) (fixed/xy 7 8 :world))
|
||||
1
tui/examples/edn/edn07.edn
Normal file
1
tui/examples/edn/edn07.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(bsp/n (fixed/xy 5 6 :hello) (fixed/xy 7 8 :world))
|
||||
1
tui/examples/edn/edn08.edn
Normal file
1
tui/examples/edn/edn08.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(bsp/w (fixed/xy 5 6 :hello) (fixed/xy 7 8 :world))
|
||||
1
tui/examples/edn/edn09.edn
Normal file
1
tui/examples/edn/edn09.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(bsp/a (fixed/xy 5 6 :hello) (fixed/xy 7 8 :world))
|
||||
1
tui/examples/edn/edn10.edn
Normal file
1
tui/examples/edn/edn10.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(bsp/b (fixed/xy 5 6 :hello) (fixed/xy 7 8 :world))
|
||||
11
tui/examples/edn/edn11.edn
Normal file
11
tui/examples/edn/edn11.edn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(bsp/s
|
||||
(bsp/e (align/nw (fixed/xy 5 3 :hello))
|
||||
(bsp/e (align/n (fixed/xy 5 3 :hello))
|
||||
(align/ne (fixed/xy 5 3 :hello))))
|
||||
(bsp/s
|
||||
(bsp/e (align/w (fixed/xy 5 3 :hello))
|
||||
(bsp/e (align/c (fixed/xy 5 3 :hello))
|
||||
(align/e (fixed/xy 5 3 :hello))))
|
||||
(bsp/e (align/sw (fixed/xy 5 3 :hello))
|
||||
(bsp/e (align/s (fixed/xy 5 3 :hello))
|
||||
(align/se (fixed/xy 5 3 :hello))))))
|
||||
11
tui/examples/edn/edn12.edn
Normal file
11
tui/examples/edn/edn12.edn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(bsp/s
|
||||
(bsp/e (fixed/xy 8 5 (align/nw :hello))
|
||||
(bsp/e (fixed/xy 8 5 (align/n :hello))
|
||||
(fixed/xy 8 5 (align/ne :hello))))
|
||||
(bsp/s
|
||||
(bsp/e (fixed/xy 8 5 (align/w :hello))
|
||||
(bsp/e (fixed/xy 8 5 (align/c :hello))
|
||||
(fixed/xy 8 5 (align/e :hello))))
|
||||
(bsp/e (fixed/xy 8 5 (align/sw :hello))
|
||||
(bsp/e (fixed/xy 8 5 (align/s :hello))
|
||||
(fixed/xy 8 5 (align/se :hello))))))
|
||||
11
tui/examples/edn/edn13.edn
Normal file
11
tui/examples/edn/edn13.edn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(bsp/s
|
||||
(bsp/e (grow/xy 1 1 (fixed/xy 8 5 (align/nw :hello)))
|
||||
(bsp/e (grow/xy 1 1 (fixed/xy 8 5 (align/n :hello)))
|
||||
(grow/xy 1 1 (fixed/xy 8 5 (align/ne :hello)))))
|
||||
(bsp/s
|
||||
(bsp/e (grow/xy 1 1 (fixed/xy 8 5 (align/w :hello)))
|
||||
(bsp/e (grow/xy 1 1 (fixed/xy 8 5 (align/c :hello)))
|
||||
(grow/xy 1 1 (fixed/xy 8 5 (align/e :hello)))))
|
||||
(bsp/e (grow/xy 1 1 (fixed/xy 8 5 (align/sw :hello)))
|
||||
(bsp/e (grow/xy 1 1 (fixed/xy 8 5 (align/s :hello)))
|
||||
(grow/xy 1 1 (fixed/xy 8 5 (align/se :hello)))))))
|
||||
1
tui/examples/edn/edn14.edn
Normal file
1
tui/examples/edn/edn14.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
:map-e
|
||||
1
tui/examples/edn/edn15.edn
Normal file
1
tui/examples/edn/edn15.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(align/c :map-e)
|
||||
1
tui/examples/edn/edn16.edn
Normal file
1
tui/examples/edn/edn16.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
:map-s
|
||||
1
tui/examples/edn/edn17.edn
Normal file
1
tui/examples/edn/edn17.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
(align/c :map-s)
|
||||
73
tui/examples/edn/edn99.edn
Normal file
73
tui/examples/edn/edn99.edn
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
(align/c (bg/behind :bg0 (margin/xy 1 1 (col
|
||||
(bg/behind :bg1 (border/around :border1 (margin/xy 2 1 :label1)))
|
||||
(bg/behind :bg2 (border/around :border2 (margin/xy 4 2 :label2)))
|
||||
(bg/behind :bg3 (border/around :border3 (margin/xy 6 3 :label3)))))))
|
||||
|
||||
fn content (&self) -> dyn Render<Engine = Tui> {
|
||||
let border_style = Style::default().fg(Color::Rgb(0,0,0));
|
||||
Align::Center(Layers::new(move|add|{
|
||||
|
||||
add(&Background(Color::Rgb(0,128,128)))?;
|
||||
|
||||
add(&Margin::XY(1, 1, Stack::down(|add|{
|
||||
|
||||
add(&Layers::new(|add|{
|
||||
add(&Background(Color::Rgb(128,96,0)))?;
|
||||
add(&Border(Square(border_style)))?;
|
||||
add(&Margin::XY(2, 1, "..."))?;
|
||||
Ok(())
|
||||
}).debug())?;
|
||||
|
||||
add(&Layers::new(|add|{
|
||||
add(&Background(Color::Rgb(128,64,0)))?;
|
||||
add(&Border(Lozenge(border_style)))?;
|
||||
add(&Margin::XY(4, 2, "---"))?;
|
||||
Ok(())
|
||||
}).debug())?;
|
||||
|
||||
add(&Layers::new(|add|{
|
||||
add(&Background(Color::Rgb(96,64,0)))?;
|
||||
add(&Border(SquareBold(border_style)))?;
|
||||
add(&Margin::XY(6, 3, "~~~"))?;
|
||||
Ok(())
|
||||
}).debug())?;
|
||||
|
||||
Ok(())
|
||||
})).debug())?;
|
||||
|
||||
Ok(())
|
||||
|
||||
}))
|
||||
//Align::Center(Margin::X(1, Layers::new(|add|{
|
||||
//add(&Background(Color::Rgb(128,0,0)))?;
|
||||
//add(&Stack::down(|add|{
|
||||
//add(&Margin::Y(1, Layers::new(|add|{
|
||||
//add(&Background(Color::Rgb(0,128,0)))?;
|
||||
//add(&Align::Center("12345"))?;
|
||||
//add(&Align::Center("FOO"))
|
||||
//})))?;
|
||||
//add(&Margin::XY(1, 1, Layers::new(|add|{
|
||||
//add(&Align::Center("1234567"))?;
|
||||
//add(&Align::Center("BAR"))?;
|
||||
//add(&Background(Color::Rgb(0,0,128)))
|
||||
//})))
|
||||
//}))
|
||||
//})))
|
||||
|
||||
//Align::Y(Layers::new(|add|{
|
||||
//add(&Background(Color::Rgb(128,0,0)))?;
|
||||
//add(&Margin::X(1, Align::Center(Stack::down(|add|{
|
||||
//add(&Align::X(Margin::Y(1, Layers::new(|add|{
|
||||
//add(&Background(Color::Rgb(0,128,0)))?;
|
||||
//add(&Align::Center("12345"))?;
|
||||
//add(&Align::Center("FOO"))
|
||||
//})))?;
|
||||
//add(&Margin::XY(1, 1, Layers::new(|add|{
|
||||
//add(&Align::Center("1234567"))?;
|
||||
//add(&Align::Center("BAR"))?;
|
||||
//add(&Background(Color::Rgb(0,0,128)))
|
||||
//})))?;
|
||||
//Ok(())
|
||||
//})))))
|
||||
//}))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue