wip: big flat pt.8: wh -> xy

This commit is contained in:
🪞👃🪞 2024-12-30 20:32:55 +01:00
parent da25b28ebf
commit e958b4a2d2
27 changed files with 117 additions and 117 deletions

View file

@ -1,6 +1,5 @@
use crate::*;
use ClockCommand::{Play, Pause};
use KeyCode::{Char, Delete, Tab, Up, Down, Left, Right};
#[derive(Clone, Debug)] pub enum ArrangerCommand {
History(isize),

View file

@ -15,7 +15,7 @@ from!(<'a>|args:(&'a ArrangerTui, usize)|ArrangerVClips<'a> = Self {
rows: ArrangerScene::ppqs(&args.0.scenes, args.1),
});
render!(<Tui>|self: ArrangerVClips<'a>|Fill::wh(
render!(<Tui>|self: ArrangerVClips<'a>|Fill::xy(
col!((scene, pulses) in self.scenes.iter().zip(self.rows.iter().map(|row|row.0)) => {
Self::format_scene(self.tracks, scene, pulses)
})
@ -27,7 +27,7 @@ impl<'a> ArrangerVClips<'a> {
) -> impl Render<Tui> + use<'a> {
let height = 1.max((pulses / PPQ) as u16);
let playing = scene.is_playing(tracks);
Fixed::h(height, row!([
Fixed::y(height, row!([
Tui::bg(scene.color.base.rgb,
if playing { "" } else { " " }),
Tui::fg_bg(scene.color.lightest.rgb, scene.color.base.rgb,
@ -40,7 +40,7 @@ impl<'a> ArrangerVClips<'a> {
fn format_clip (
scene: &'a ArrangerScene, index: usize, track: &'a ArrangerTrack, w: u16, h: u16
) -> impl Render<Tui> + use<'a> {
Fixed::wh(w, h, Layers::new(move |add|{
Fixed::xy(w, h, Layers::new(move |add|{
if let Some(Some(phrase)) = scene.clips.get(index) {
let mut bg = TuiTheme::border_bg();
let name = &(phrase as &Arc<RwLock<MidiClip>>).read().unwrap().name.to_string();
@ -53,7 +53,7 @@ impl<'a> ArrangerVClips<'a> {
}
};
add(&Tui::bg(bg,
Push::x(1, Fixed::w(w, &name.as_str()[0..max_w])))
Push::x(1, Fixed::x(w, &name.as_str()[0..max_w])))
)?;
}
Ok(())

View file

@ -25,7 +25,7 @@ render!(<Tui>|self: ArrangerVHead<'a>|Push::x(self.scenes_w, row!(
Tui::fg(color.lightest.rgb, field)
])
}
Tui::bg(color.base.rgb, Min::xy(w as u16, h, Fixed::wh(w as u16, 5, col!([
Tui::bg(color.base.rgb, Min::xy(w as u16, h, Fixed::xy(w as u16, 5, col!([
row(color, &Self::format_name(track, w)),
row(color, &Self::format_input(track)?),
row(color, &Self::format_output(track)?),