mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
This commit is contained in:
parent
287983c140
commit
45dc05acd6
3 changed files with 43 additions and 41 deletions
|
|
@ -24,45 +24,47 @@ impl<T: Content<TuiOut>> Content<TuiOut> for ErrorBoundary<TuiOut, T> {
|
|||
|
||||
impl App {
|
||||
pub fn view (model: &Self) -> impl Content<TuiOut> + '_ {
|
||||
ErrorBoundary::new(Ok(Some(Tui::bg(Black, "give or take"))))
|
||||
ErrorBoundary::new(Ok(Some(Tui::bg(Black, model.view_nil()))))
|
||||
//ErrorBoundary::new(Take::take(model, &mut model.config.view.clone()))
|
||||
//ErrorBoundary::new(Give::give(model, &mut model.config.view.clone()))
|
||||
}
|
||||
}
|
||||
|
||||
content!(TuiOut: |self: App| ErrorBoundary::new(Ok(Some(Tui::bg(Black, self.view_nil())))));
|
||||
|
||||
#[tengri_proc::view(TuiOut)]
|
||||
impl App {
|
||||
//pub fn view_nil (model: &Self) -> impl Content<TuiOut> {
|
||||
//"nil"
|
||||
//}
|
||||
//pub fn view_dialog (model: &Self) -> impl Content<TuiOut> + use<'_> {
|
||||
//model.dialog.as_ref().map(|dialog|Bsp::b("",
|
||||
//Fixed::xy(70, 23, Tui::fg_bg(Rgb(255,255,255), Rgb(16,16,16), Bsp::b(
|
||||
//Repeat(" "), Outer(true, Style::default().fg(Tui::g(96)))
|
||||
//.enclose(dialog))))))
|
||||
//}
|
||||
//pub fn view_meters_input (model: &Self) -> impl Content<TuiOut> + use<'_> {
|
||||
//model.project.sampler().map(|s|
|
||||
pub fn view_nil (&self) -> impl Content<TuiOut> + '_ {
|
||||
"nil"
|
||||
}
|
||||
pub fn view_dialog (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
self.dialog.as_ref().map(|dialog|Bsp::b("",
|
||||
Fixed::xy(70, 23, Tui::fg_bg(Rgb(255,255,255), Rgb(16,16,16), Bsp::b(
|
||||
Repeat(" "), Outer(true, Style::default().fg(Tui::g(96)))
|
||||
.enclose(dialog))))))
|
||||
}
|
||||
//pub fn view_meters_input (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
//self.project.sampler().map(|s|
|
||||
//s.view_meters_input())
|
||||
//}
|
||||
//pub fn view_meters_output (model: &Self) -> impl Content<TuiOut> + use<'_> {
|
||||
//model.project.sampler().map(|s|
|
||||
//pub fn view_meters_output (&self) -> impl Content<TuiOut> + use<'_> {
|
||||
//self.project.sampler().map(|s|
|
||||
//s.view_meters_output())
|
||||
//}
|
||||
//pub fn view_history (model: &Self) -> impl Content<TuiOut> {
|
||||
//Fixed::y(1, Fill::x(Align::w(FieldH(model.color,
|
||||
//format!("History ({})", model.history.len()),
|
||||
//model.history.last().map(|last|Fill::x(Align::w(format!("{:?}", last.0))))))))
|
||||
//pub fn view_history (&self) -> impl Content<TuiOut> {
|
||||
//Fixed::y(1, Fill::x(Align::w(FieldH(self.color,
|
||||
//format!("History ({})", self.history.len()),
|
||||
//self.history.last().map(|last|Fill::x(Align::w(format!("{:?}", last.0))))))))
|
||||
//}
|
||||
//pub fn view_status_h2 (model: &Self) -> impl Content<TuiOut> {
|
||||
//model.update_clock();
|
||||
//let theme = model.color;
|
||||
//let clock = model.clock();
|
||||
//pub fn view_status_h2 (&self) -> impl Content<TuiOut> {
|
||||
//self.update_clock();
|
||||
//let theme = self.color;
|
||||
//let clock = self.clock();
|
||||
//let playing = clock.is_rolling();
|
||||
//let cache = clock.view_cache.clone();
|
||||
////let selection = model.selection().describe(model.tracks(), model.scenes());
|
||||
//let hist_len = model.history.len();
|
||||
//let hist_last = model.history.last();
|
||||
////let selection = self.selection().describe(self.tracks(), self.scenes());
|
||||
//let hist_len = self.history.len();
|
||||
//let hist_last = self.history.last();
|
||||
//Fixed::y(2, Stack::east(move|add: &mut dyn FnMut(&dyn Render<TuiOut>)|{
|
||||
//add(&Fixed::x(5, Tui::bg(if playing { Rgb(0, 128, 0) } else { Rgb(128, 64, 0) },
|
||||
//Either::new(false, // TODO
|
||||
|
|
@ -97,8 +99,8 @@ impl App {
|
|||
////hist_last.map(|last|Fill::x(Align::w(format!("{:?}", last.0))))))),
|
||||
////""
|
||||
////));
|
||||
//////if let Some(last) = model.history.last() {
|
||||
//////add(&FieldV(theme, format!("History ({})", model.history.len()),
|
||||
//////if let Some(last) = self.history.last() {
|
||||
//////add(&FieldV(theme, format!("History ({})", self.history.len()),
|
||||
//////Fill::x(Align::w(format!("{:?}", last.0)))));
|
||||
//////}
|
||||
//}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue