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

@ -42,10 +42,10 @@ impl Mixer {
}
pub fn render (state: &Mixer, buf: &mut Buffer, mut area: Rect)
-> Usually<(u16, u16)>
-> Usually<Rect>
{
if area.height < 2 {
return Ok((0, 0))
return Ok(area)
}
area.x = area.width.saturating_sub(80) / 2;
area.width = area.width.min(80);
@ -87,7 +87,7 @@ pub fn render (state: &Mixer, buf: &mut Buffer, mut area: Rect)
//fn render_meters (
//state: &mut Mixer,
//stdout: &mut Stdout,
//offset: (u16, u16)
//offset: Rect
//) -> Result<(), Box<dyn Error>> {
//let move_to = |col, row| crossterm::cursor::MoveTo(offset.0 + col, offset.1 + row);
//for (i, track) in state.tracks.iter().enumerate() {
@ -102,7 +102,7 @@ pub fn render (state: &Mixer, buf: &mut Buffer, mut area: Rect)
//}
}
}
Ok((20,10))
Ok(area)
}
pub fn handle (state: &mut Mixer, event: &EngineEvent) -> Result<(), Box<dyn Error>> {