mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
This commit is contained in:
parent
f81f16b47b
commit
d10107684d
5 changed files with 37 additions and 27 deletions
|
|
@ -49,6 +49,9 @@ impl<'t> DslNs<'t, Box<dyn Render<TuiOut>>> for App {
|
|||
"bg" (color: Color, x: Box<dyn Render<TuiOut>>) => Box::new(Tui::bg(color, x)),
|
||||
"fg/bg" (fg: Color, bg: Color, x: Box<dyn Render<TuiOut>>) => Box::new(Tui::fg_bg(fg, bg, x)),
|
||||
|
||||
"either" (cond: bool, a: Box<dyn Render<TuiOut>>, b: Box<dyn Render<TuiOut>>) =>
|
||||
Box::new(Either(cond, a, b)),
|
||||
|
||||
"bsp/n" (a: Box<dyn Render<TuiOut>>, b: Box<dyn Render<TuiOut>>) => Box::new(Bsp::n(a, b)),
|
||||
"bsp/s" (a: Box<dyn Render<TuiOut>>, b: Box<dyn Render<TuiOut>>) => Box::new(Bsp::s(a, b)),
|
||||
"bsp/e" (a: Box<dyn Render<TuiOut>>, b: Box<dyn Render<TuiOut>>) => Box::new(Bsp::e(a, b)),
|
||||
|
|
@ -83,6 +86,23 @@ impl<'t> DslNs<'t, Box<dyn Render<TuiOut>>> for App {
|
|||
"max/xy" (x: u16, y: u16, c: Box<dyn Render<TuiOut>>) => Box::new(Max::xy(x, y, c)),
|
||||
});
|
||||
dsl_words!(|app| -> Box<dyn Render<TuiOut>> {
|
||||
":logo" => Box::new(Fixed::xy(32, 7, Tui::bold(true, Tui::fg(Rgb(240,200,180), Stack::south(|add|{
|
||||
add(&Fixed::y(1, ""));
|
||||
add(&Fixed::y(1, ""));
|
||||
add(&Fixed::y(1, "~~ ╓─╥─╖ ╓──╖ ╥ ╖ ~~~~~~~~~~~~"));
|
||||
add(&Fixed::y(1, Bsp::e("~~~~ ║ ~ ╟─╌ ~╟─< ~~ ", Bsp::e(Tui::fg(Rgb(230,100,40), "v0.3.0"), " ~~"))));
|
||||
add(&Fixed::y(1, "~~~~ ╨ ~ ╙──╜ ╨ ╜ ~~~~~~~~~~~~"));
|
||||
}))))),
|
||||
":meters/input" => Box::new("Input Meters"),
|
||||
":meters/output" => Box::new("Output Meters"),
|
||||
":status" => Box::new("Status Bar"),
|
||||
":tracks/names" => Box::new("Track Names"),
|
||||
":tracks/inputs" => Box::new("Track Inputs"),
|
||||
":tracks/devices" => Box::new("Track Devices"),
|
||||
":tracks/outputs" => Box::new("Track Outputs"),
|
||||
":scenes/names" => Box::new("Scene Names"),
|
||||
":editor" => Box::new("Editor"),
|
||||
":scenes" => Box::new("Editor"),
|
||||
":dialog/menu" => Box::new(if let Dialog::Menu(selected, items) = &app.dialog {
|
||||
let items = items.clone();
|
||||
let selected = *selected;
|
||||
|
|
@ -98,13 +118,6 @@ impl<'t> DslNs<'t, Box<dyn Render<TuiOut>>> for App {
|
|||
} else {
|
||||
None
|
||||
}),
|
||||
":logo" => Box::new(Fixed::xy(32, 7, Tui::bold(true, Tui::fg(Rgb(240,200,180), Stack::south(|add|{
|
||||
add(&Fixed::y(1, ""));
|
||||
add(&Fixed::y(1, ""));
|
||||
add(&Fixed::y(1, "~~ ╓─╥─╖ ╓──╖ ╥ ╖ ~~~~~~~~~~~~"));
|
||||
add(&Fixed::y(1, Bsp::e("~~~~ ║ ~ ╟─╌ ~╟─< ~~ ", Bsp::e(Tui::fg(Rgb(230,100,40), "v0.3.0"), " ~~"))));
|
||||
add(&Fixed::y(1, "~~~~ ╨ ~ ╙──╜ ╨ ╜ ~~~~~~~~~~~~"));
|
||||
}))))),
|
||||
":templates" => Box::new({
|
||||
let modes = app.config.modes.clone();
|
||||
let height = (modes.read().unwrap().len() * 2) as u16;
|
||||
|
|
@ -225,14 +238,6 @@ pub fn view_nil (_: &App) -> Box<dyn Render<TuiOut>> {
|
|||
////.enclose(Fill::xy(browser)))
|
||||
//},
|
||||
//
|
||||
//pub fn view_meters_input (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
//self.project.sampler().map(|s|
|
||||
//s.view_meters_input())
|
||||
//}
|
||||
//pub fn view_meters_output (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
//self.project.sampler().map(|s|
|
||||
//s.view_meters_output())
|
||||
//}
|
||||
//pub fn view_history (&self) -> impl Content<TuiOut> {
|
||||
//Fixed::y(1, Fill::x(Align::w(FieldH(self.color,
|
||||
//format!("History ({})", self.history.len()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue