wip: fix arranger layout

This commit is contained in:
🪞👃🪞 2025-04-11 20:46:10 +03:00
parent c7ee3185c1
commit 6536f1612e
2 changed files with 10 additions and 7 deletions

View file

@ -45,10 +45,10 @@ impl<'a> Content<TuiOut> for ArrangerView<'a> {
let ins = |x|Bsp::s(self.inputs(), x);
let tracks = |x|Bsp::s(self.tracks(), x);
let outs = |x|Bsp::n(self.outputs(), x);
let bg = |x|Tui::bg(Reset, x);
let track_scroll = |x|Bsp::s(&self.track_scroll, x);
let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
ins(scene_scroll(track_scroll(tracks(outs(bg(self.scenes()))))))
let bg = |x|Tui::bg(Green, x);
//let track_scroll = |x|Bsp::s(&self.track_scroll, x);
//let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
ins(tracks(outs(bg(self.scenes()))))
}
}
@ -68,13 +68,13 @@ impl<'a> ArrangerView<'a> {
outputs_height: app.h_outputs().saturating_sub(1),
outputs_count: app.midi_outs.len(),
scenes_height: app.h_tracks_area(),
scenes_height: app.h_scenes_area(),
scene_selected: app.selected().scene(),
scene_count: app.scenes.len(),
scene_last: app.scenes.len().saturating_sub(1),
scene_scroll: Fill::y(Fixed::x(1, ScrollbarV {
offset: app.scene_scroll,
length: app.h_tracks_area() as usize,
length: app.h_scenes_area() as usize,
total: app.h_scenes() as usize,
})),
@ -205,6 +205,7 @@ view!(TuiOut: |self: Tek| self.size.of(View(self, self.view)); {
//":scene-add" => self.view_scene_add().boxed(),
//":scenes" => self.view_scenes().boxed(),
//":tracks" => self.view_tracks().boxed(),
":nil" => Box::new("nil"),
":transport" => self.view_transport().boxed(),
":arranger" => ArrangerView::new(self).boxed(),
":editor" => self.editor.as_ref().map(|e|Bsp::e(e.clip_status(), e.edit_status())).boxed(),

View file

@ -39,12 +39,14 @@ impl Tek {
pub(crate) fn h (&self) -> u16 {
self.size.h() as u16
}
/// Height available to display tracks.
/// Height available to display track headers.
pub(crate) fn h_tracks_area (&self) -> u16 {
//5
self.h().saturating_sub(self.h_inputs() + self.h_outputs())
}
/// Height available to display tracks.
pub(crate) fn h_scenes_area (&self) -> u16 {
//15
self.h().saturating_sub(self.h_tracks_area())
}
/// Height taken by all inputs.