panic hook; two sequencers

This commit is contained in:
🪞👃🪞 2024-06-07 15:37:27 +03:00
parent 0ee9e58dc7
commit abee6cc2c8
16 changed files with 927 additions and 828 deletions

View file

@ -27,6 +27,49 @@ impl<'a> WidgetRef for ActionBar<'a> {
}
}
pub fn draw_leaf (buffer: &mut Buffer, area: Rect, y: u16, x: u16, text: &str) {
use ratatui::style::{Style, Stylize};
buffer.set_string(
area.x + x, area.y + y,
format!(""),
Style::default().black().dim()
);
buffer.set_string(
area.x + x + 1, area.y + y,
format!("{text}"),
Style::default()
);
buffer.set_string(
area.x + x + text.len() as u16 + 1, area.y + y,
format!(""),
Style::default().black().dim()
);
buffer.set_string(
area.x + x, area.y + 1 + y,
format!("{}", "".repeat(text.len() as usize)),
Style::default().black()
);
}
pub fn draw_box (buffer: &mut Buffer, area: Rect) {
use ratatui::style::{Style, Stylize};
buffer.set_string(
area.x, area.y,
format!("{}", "".repeat((area.width - 2).into())),//.repeat(area.width.saturating_sub(2).into())),
Style::default().black()
);
buffer.set_string(
area.x, area.y + area.height - 1,
format!("{}", "".repeat((area.width - 2).into())),//.repeat(area.width.saturating_sub(2).into())),
Style::default().black()
);
//buffer.set_string(
//area.x, area.y + area.height,
//format!("╰{}╯", "─".repeat(area.width.saturating_sub(2).into())),
//Style::default().black()
//);
}
pub fn render_toolbar_vertical (
stdout: &mut std::io::Stdout,
offset: (u16, u16),