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

@ -13,10 +13,10 @@ impl Plugin {
}
pub fn render (state: &Plugin, buf: &mut Buffer, Rect { x, y, width, height }: Rect)
-> Usually<(u16, u16)>
-> Usually<Rect>
{
let style = Style::default().gray();
draw_box(buf, Rect { x, y: y, width: 40, height: 8 });
draw_box(buf, Rect { x, y, width: 40, height: 8 });
buf.set_string(x + 1, y + 1, &format!(" {}", state.name), style.white().bold());
buf.set_string(x + 13, y + 1, &format!("│ Plugin Name"), style.not_dim());
buf.set_string(x + 0, y + 2, &format!("├--------------------------------------┤"), style.dim());
@ -24,7 +24,7 @@ pub fn render (state: &Plugin, buf: &mut Buffer, Rect { x, y, width, height }: R
buf.set_string(x + 1, y + 4, &format!(" Parameter 2 0.0"), style);
buf.set_string(x + 1, y + 5, &format!(" Parameter 3 0.0"), style);
buf.set_string(x + 1, y + 6, &format!(" Parameter 4 0.0"), style);
Ok((40, 7))
Ok(Rect { x, y, width: 40, height: 7 })
}
pub fn handle (state: &mut Plugin, event: &EngineEvent) -> Result<(), Box<dyn Error>> {