diff --git a/crates/tek/src/tui/app_arranger.rs b/crates/tek/src/tui/app_arranger.rs index 2e0c7abc..57490c2f 100644 --- a/crates/tek/src/tui/app_arranger.rs +++ b/crates/tek/src/tui/app_arranger.rs @@ -110,9 +110,15 @@ impl Audio for ArrangerTui { render!(|self: ArrangerTui|{ let arranger_focused = self.arranger_focused(); let border = Lozenge(Style::default().bg(TuiTheme::border_bg()).fg(TuiTheme::border_fg(arranger_focused))); - col_up!([ - WorldClock::from(self), - PlayClock::from(self), + col!([ + lay!([ + Tui::fill_x(Lozenge(Style::default())), + Tui::outset_xy(1, 1, row!([ + WorldClock::from(self), + " ", + PlayClock::from(self), + ])) + ]), col!([ Tui::fixed_y(self.splits[0], lay!([ border.wrap(Tui::grow_y(1, Layers::new(move |add|{ @@ -332,7 +338,7 @@ render!(|self: ArrangerStatus|{ }; //let commands = commands.iter().reduce(String::new(), |s, (a, b, c)| format!("{s} {a}{b}{c}")); - Tui::bg(status_bar_bg, Tui::fill_x(Tui::to_east(mode, commands))) + Tui::bg(status_bar_bg, Tui::fill_x(row!([mode, commands]))) }); @@ -630,37 +636,32 @@ render!(|self: ArrangerVerticalContent<'a>|Tui::fixed_y( col!((scene, pulses) in self.scenes.iter().zip(self.rows.iter().map(|row|row.0)) => { let height = 1.max((pulses / PPQ) as u16); let playing = scene.is_playing(self.tracks); - Tui::fixed_y( - height, - Tui::to_east( - Tui::to_east( - if playing { "▶ " } else { " " }, - Tui::bold(true, scene.name.read().unwrap().as_str()) - ), - row!((track, w) in self.cols.iter().map(|col|col.0).enumerate() => { - Tui::fixed_xy(w as u16, height, Layers::new(move |add|{ - let mut bg = TuiTheme::border_bg(); - match (self.tracks.get(track), scene.clips.get(track)) { - (Some(track), Some(Some(phrase))) => { - let name = &(phrase as &Arc>).read().unwrap().name; - let name = format!("{}", name); - let max_w = name.len().min((w as usize).saturating_sub(2)); - let color = phrase.read().unwrap().color; - bg = color.dark.rgb; - if let Some((_, Some(ref playing))) = track.player.play_phrase() { - if *playing.read().unwrap() == *phrase.read().unwrap() { - bg = color.light.rgb - } - }; - add(&Tui::fixed_x(w as u16, Tui::push_x(1, &name.as_str()[0..max_w])))?; - }, - _ => {} - }; - //add(&Background(bg)) - Ok(()) - })) - }) - ) + Tui::fixed_y(height, row!([ + if playing { "▶ " } else { " " }, + Tui::bold(true, scene.name.read().unwrap().as_str()), + row!((track, w) in self.cols.iter().map(|col|col.0).enumerate() => { + Tui::fixed_xy(w as u16, height, Layers::new(move |add|{ + let mut bg = TuiTheme::border_bg(); + match (self.tracks.get(track), scene.clips.get(track)) { + (Some(track), Some(Some(phrase))) => { + let name = &(phrase as &Arc>).read().unwrap().name; + let name = format!("{}", name); + let max_w = name.len().min((w as usize).saturating_sub(2)); + let color = phrase.read().unwrap().color; + bg = color.dark.rgb; + if let Some((_, Some(ref playing))) = track.player.play_phrase() { + if *playing.read().unwrap() == *phrase.read().unwrap() { + bg = color.light.rgb + } + }; + add(&Tui::fixed_x(w as u16, Tui::push_x(1, &name.as_str()[0..max_w])))?; + }, + _ => {} + }; + //add(&Background(bg)) + Ok(()) + })) + })]) ) }) )); diff --git a/crates/tek/src/tui/app_sequencer.rs b/crates/tek/src/tui/app_sequencer.rs index 9538aa11..dccd4ede 100644 --- a/crates/tek/src/tui/app_sequencer.rs +++ b/crates/tek/src/tui/app_sequencer.rs @@ -90,8 +90,14 @@ render!(|self: SequencerTui|{ //col_up!([ //Tui::max_y(2, SequencerStatusBar::from(self)), col!([ - WorldClock::from(self), - PlayClock::from(self), + lay!([ + Tui::fill_x(Lozenge(Style::default())), + Tui::outset_xy(1, 1, row!([ + WorldClock::from(self), + " ", + PlayClock::from(self), + ])) + ]), Tui::min_y(20, row!([ Tui::min_x(20, col!([ Tui::fixed_y(4, PhraseSelector::play_phrase( diff --git a/crates/tek/src/tui/view_phrase_editor.rs b/crates/tek/src/tui/view_phrase_editor.rs index 7de495b2..81be8ff9 100644 --- a/crates/tek/src/tui/view_phrase_editor.rs +++ b/crates/tek/src/tui/view_phrase_editor.rs @@ -123,13 +123,13 @@ render!(|self: PhraseView<'a>|{ add(&Tui::fill_xy(Tui::at_se(Tui::pull_x(1, Tui::fg(title_color, lower_right)))))?; Ok(()) }); - let content = Tui::bg(Color::Rgb(40, 50, 30), Tui::fill_x(Tui::to_east( + let content = Tui::bg(Color::Rgb(40, 50, 30), Tui::fill_x(row!([ Tui::push_y(1, Tui::fill_y(Widget::new(|to:[u16;2]|Ok(Some(to.clip_w(2))), keys))), Tui::fill_x(lay!([ Tui::push_y(1, Tui::fill_x(Widget::new(|to|Ok(Some(to)), notes))), Tui::push_y(1, Widget::new(|to|Ok(Some(to)), cursor)) ])), - ))); + ]))); lay!([ indicators, content