From b130471f12d547a4fea83d16c34210aa8c49ae67 Mon Sep 17 00:00:00 2001 From: i do not exist Date: Fri, 19 Jun 2026 20:30:00 +0300 Subject: [PATCH] 79e... --- src/tek.rs | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/src/tek.rs b/src/tek.rs index 7d786348..cf8860b4 100644 --- a/src/tek.rs +++ b/src/tek.rs @@ -382,12 +382,7 @@ pub fn view_logo () -> impl Draw { /// let _ = tek::view_transport(true, x.clone(), x.clone(), x.clone()); /// let _ = tek::view_transport(false, x.clone(), x.clone(), x.clone()); /// ``` -pub fn view_transport ( - play: bool, - bpm: &Arc>, - beat: &Arc>, - time: &Arc>, -) -> impl Draw { +pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Draw { let theme = ItemTheme::G[96]; bg(Black, east!(above( wh_full(origin_w(button_play_pause(play))), @@ -404,7 +399,7 @@ pub fn view_transport ( /// let _ = tek::view_status(None, x.clone(), x.clone(), x.clone()); /// let _ = tek::view_status(Some("".into()), x.clone(), x.clone(), x.clone()); /// ``` -pub fn view_status (sel: Option>, sr: &str, buf: &str, lat: &str) -> impl Draw { +pub fn view_status (sel: Option<&str>, sr: &str, buf: &str, lat: &str) -> impl Draw { let theme = ItemTheme::G[96]; let sr = field_h(theme, "SR", sr); let buf = field_h(theme, "Buf", buf); @@ -520,7 +515,7 @@ pub fn draw_info_v (sample: Option<&Arc>>) -> impl Draw + us bold(true, "× No sample."), "[r] record", "[Shift-F9] import", - ))); + )).draw(to)); either(sample.is_some(), a, b) } @@ -554,30 +549,22 @@ pub fn io_ports <'a, T: PortsSizes<'a>> ( ) -> impl Draw + 'a { iter(items, move|( _index, name, connections, y, y2 - ): (usize, &'a Arc, &'a [Connect], usize, usize), _| - iter_south( - y as u16, - (y2-y) as u16, - south( - h_full(bold(true, fg_bg(fg, bg, origin_w(east(" 󰣲 ", name))))), - iter( - ||connections.iter(), - move|connect: &'a Connect, index|iter_south( - index as u16, - 1, - h_full(origin_w(bold(false, fg_bg(fg, bg, &connect.info)))) - ) - ) - ) - ) - ) + ): (usize, &'a Arc, &'a [Connect], usize, usize), _| { + let conns = ||connections.iter(); + let conn = move|connect: &'a Connect, index|iter_south_fixed( + index as u16, 1, h_full(origin_w(bold(false, fg_bg(fg, bg, &connect.info)))) + ); + iter_south(y as u16, (y2-y) as u16, + south(h_full(bold(true, fg_bg(fg, bg, origin_w(east(" 󰣲 ", name))))), + iter(conns, conn))) + }) } /// CLI banner. pub(crate) const HEADER: &'static str = r#" ~ █▀█▀█ █▀▀█ █ █ ~~~ ~ ~ ~~ ~ ~ ~ ~~ ~ ~ ~ ~ - █ term█▀ █▀▀▄ ~ v0.4.0, 2026 winter (or is it) ~ + █ █▀ █▀▀▄ ~ v0.4.0, 2026 winter (or is it) ~ ~ ▀ █▀▀█ ▀ ▀ ~ ~~~ ~ ~ ~ ~ ~~~ ~~~ ~ ~~ "#; /// Total state