wip: layout

This commit is contained in:
🪞👃🪞 2024-06-12 23:21:56 +03:00
parent ac865824cc
commit d627d257ad
13 changed files with 220 additions and 131 deletions

View file

@ -41,12 +41,12 @@ impl Transport {
}
pub fn render (state: &Transport, buf: &mut Buffer, mut area: Rect)
-> Usually<(u16, u16)>
-> Usually<Rect>
{
area.x = area.width.saturating_sub(80) / 2;
area.width = area.width.min(80);
area.height = 5;
draw_box(buf, area);
//draw_box(buf, area);
draw_leaf(buf, area, 1, 0, "REC");
draw_leaf(buf, area, 1, 5, "DUB");
draw_leaf(buf, area, 1, 10, "STOP");
@ -91,7 +91,6 @@ pub fn render (state: &Transport, buf: &mut Buffer, mut area: Rect)
draw_leaf(buf, area, 3, 48, &format!("Rate {:>6}Hz", rate));
draw_leaf(buf, area, 3, 63, &format!("Frame {:>10}", frame));
}
Ok((area.width, area.height))
//let bbt = position.pos.bbt().map(|mut bbt|*bbt
//.with_bpm(state.bpm)
//.with_timesig(state.timesig.0, state.timesig.1));
@ -131,6 +130,7 @@ pub fn render (state: &Transport, buf: &mut Buffer, mut area: Rect)
//None => String::from("(none)")
//}).render(area.clone().offset(Offset { x: 50, y: 2 }), buf);
//}
Ok(area)
}
//pub fn render (