diff --git a/crates/tek/src/layout/bsp.rs b/crates/tek/src/layout/bsp.rs index 1cdead54..8353c1f9 100644 --- a/crates/tek/src/layout/bsp.rs +++ b/crates/tek/src/layout/bsp.rs @@ -17,15 +17,15 @@ pub enum Bsp, Y: Render> { Null(PhantomData), } -render!(|self:Bsp, Y: Render>|match self { - Bsp::Null(_) => { () }, - Bsp::N(a, b) => { todo!("") }, - Bsp::S(a, b) => { todo!("") }, - Bsp::E(a, b) => { todo!("") }, - Bsp::W(a, b) => { todo!("") }, - Bsp::A(a, b) => { todo!("") }, - Bsp::B(a, b) => { todo!("") }, -}); +render!(|self:Bsp, Y: Render>|render(|to|{Ok(match self { + Bsp::Null(_) => (), + Bsp::N(a, b) => (), + Bsp::S(a, b) => (), + Bsp::E(a, b) => (), + Bsp::W(a, b) => (), + Bsp::A(a, b) => (), + Bsp::B(a, b) => (), +})})); impl, Y: Render> Bsp { pub fn new (x: X) -> Self { Self::A(Some(x), None) } diff --git a/crates/tek/src/tui/piano_horizontal.rs b/crates/tek/src/tui/piano_horizontal.rs index 78fdb539..f19fd813 100644 --- a/crates/tek/src/tui/piano_horizontal.rs +++ b/crates/tek/src/tui/piano_horizontal.rs @@ -48,34 +48,19 @@ render!(|self: PianoHorizontal|{ let time_point = self.point.time_point(); let note_point = self.point.note_point(); let note_len = self.point.note_len(); - let timeline = move||PianoHorizontalTimeline { - color, - time_start, - time_zoom, - }; - let notes = move||PianoHorizontalNotes { - source: &self.buffer, - time_start, - note_hi, - }; - let cursor = move||PianoHorizontalCursor { - time_zoom, - time_point, - time_start, - note_point: note_point, - note_len: note_len, - note_hi: note_hi, - note_lo: note_lo, - }; - let keys = move||PianoHorizontalKeys { - color: self.color, - note_lo, - note_hi, - note_point: Some(note_point), - }; - Tui::fill_xy(Tui::bg(bg, Tui::split_s(false, 1, - Tui::fill_x(Tui::push_x(5, timeline())), - Tui::split_e(true, 5, Tui::debug(lay!([&self.size, notes(), cursor()])), keys()), + let keys = move||PianoHorizontalKeys { color, note_lo, note_hi, note_point: Some(note_point), }; + let timeline = move||PianoHorizontalTimeline { color, time_start, time_zoom, }; + let notes = move||PianoHorizontalNotes { source: &self.buffer, time_start, note_hi, }; + let cursor = move||PianoHorizontalCursor { time_zoom, time_point, time_start, note_point, note_len, note_hi, note_lo, }; + let keys_width = 5; + Tui::fill_xy(Tui::bg(bg, Bsp::s( + Tui::fill_x(Tui::push_x(keys_width, timeline())), + Bsp::w( + Tui::shrink_x(keys_width, + Tui::fill_x(Tui::debug(lay!([&self.size, notes(), cursor()]))), + ), + Tui::fixed_x(keys_width, keys()) + ), ))) });