mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
panic hook; two sequencers
This commit is contained in:
parent
0ee9e58dc7
commit
abee6cc2c8
16 changed files with 927 additions and 828 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue