From 50bb8cab0786d3fa625758220a7e6f99294ee24e Mon Sep 17 00:00:00 2001 From: unspeaker Date: Wed, 1 Jan 2025 21:37:46 +0100 Subject: [PATCH] piecing back together the groovebox --- layout/src/ops.rs | 7 +++---- src/groovebox.rs | 7 +++---- src/pool.rs | 8 ++------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/layout/src/ops.rs b/layout/src/ops.rs index 3220ee4c..698e1011 100644 --- a/layout/src/ops.rs +++ b/layout/src/ops.rs @@ -112,12 +112,11 @@ impl Content for Map where } fn render (&self, to: &mut E::Output) { let mut index = 0; - let area = self.layout(to.area()); - //panic!("{area:?}"); - //to.blit(&format!("{area:?}"), 0, 0, None); + //let area = self.layout(to.area()); for item in (self.1)() { let item = (self.2)(item, index); - to.place(area.into(), &item); + //to.place(area.into(), &item); + to.place(to.area().into(), &item); index += 1; } } diff --git a/src/groovebox.rs b/src/groovebox.rs index c5e348ca..3ec67bdc 100644 --- a/src/groovebox.rs +++ b/src/groovebox.rs @@ -128,10 +128,9 @@ render!(Tui: (self: Groovebox) => { PhraseSelector::play_phrase(&self.player), PhraseSelector::next_phrase(&self.player), ))); - PoolView(&self.pool) - //let pool = PoolView(&self.pool); - //let with_pool = move|x|Bsp::w(Fixed::x(pool_w, Pull::y(1, Fill::y(Align::e(pool)))), x); - //with_pool(col!(transport, selector)) + let pool = PoolView(&self.pool); + let with_pool = move|x|Bsp::w(Pull::y(1, Align::e(Fill::y(Fixed::x(pool_w, pool)))), x); + with_pool(Fill::xy(Align::nw(col!(transport, selector)))) //selector //let sampler = move|x|Bsp::e( //Fixed::x(sampler_w, Fill::xy(col!( diff --git a/src/pool.rs b/src/pool.rs index d68d1c47..45baa1dc 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -219,12 +219,8 @@ render!(Tui: (self: PoolView<'a>) => { offset(Tui::bg(if selected { color.light.rgb } else { color.base.rgb }, lay!( Align::w(Tui::fg(color.lightest.rgb, format!(" {i:>3} {name}"))), Align::e(Tui::fg(color.lightest.rgb, format!("{length} "))), - Align::w(Tui::when(selected, Tui::bold(true, Tui::fg(color.lightest.rgb, "[")))), - Align::e(Tui::when(selected, Tui::bold(true, Tui::fg(color.lightest.rgb, "]")))), - //Tui::when(, Fixed::y(1, Tui::fg(Color::Green, lay!( - //Align::w(format!("[")), - //Align::e(format!("]")), - //)))) + Align::w(Tui::when(selected, Tui::bold(true, Tui::fg(TuiTheme::g(255), "▶")))), + Align::e(Tui::when(selected, Tui::bold(true, Tui::fg(TuiTheme::g(255), "◀")))), )))/* //format!(" {i} {name} {length} ")[> //Push::y(i as u16 * 2, Fixed::y(2, Tui::bg(color.base.rgb, Fill::x(