From 2073bb541df6830c04b036e134b6f95d24a47c28 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Sun, 15 Sep 2024 19:08:26 +0300 Subject: [PATCH] tall corners --- crates/tek_core/src/tui.rs | 66 +++----- crates/tek_sequencer/src/arranger.rs | 233 +++++++++++++------------- crates/tek_sequencer/src/transport.rs | 27 +-- 3 files changed, 144 insertions(+), 182 deletions(-) diff --git a/crates/tek_core/src/tui.rs b/crates/tek_core/src/tui.rs index 300fbd9d..2a5cbce1 100644 --- a/crates/tek_core/src/tui.rs +++ b/crates/tek_core/src/tui.rs @@ -447,7 +447,7 @@ pub struct Border(pub S); impl Widget for Border { type Engine = Tui; fn layout (&self, to: [u16;2]) -> Perhaps<[u16;2]> { - Outset::XY(1, 1, "").layout(to) + Ok(Some([0, 0])) } fn render (&self, to: &mut TuiOutput) -> Usually<()> { let area = to.area(); @@ -577,7 +577,7 @@ pub trait BorderStyle: Send + Sync { } macro_rules! border { - ($($T:ty { + ($($T:ident { $nw:literal $n:literal $ne:literal $w:literal $e:literal $sw:literal $s:literal $se:literal $($x:tt)* }),+) => {$( @@ -592,10 +592,11 @@ macro_rules! border { const SE: &'static str = $se; $($x)* } + pub struct $T(pub Style); impl Widget for $T { type Engine = Tui; - fn layout (&self, area: [u16;2]) -> Perhaps<[u16;2]> { - Ok(Some(area)) + fn layout (&self, _: [u16;2]) -> Perhaps<[u16;2]> { + Ok(Some([0,0])) } fn render (&self, to: &mut TuiOutput) -> Usually<()> { self.draw(to) @@ -604,97 +605,72 @@ macro_rules! border { )+} } -pub struct Square(pub Style); -pub struct SquareBold(pub Style); -pub struct Tab(pub Style); -pub struct Lozenge(pub Style); -pub struct Brace(pub Style); -pub struct LozengeDotted(pub Style); -pub struct Quarter(pub Style); -pub struct QuarterV(pub Style); -pub struct Chamfer(pub Style); -pub struct Corners(pub Style); - border! { Square { "┌" "─" "┐" "│" "│" "└" "─" "┘" - fn style (&self) -> Option