mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
wip: fix arranger layout
This commit is contained in:
parent
c7ee3185c1
commit
6536f1612e
2 changed files with 10 additions and 7 deletions
|
|
@ -45,10 +45,10 @@ impl<'a> Content<TuiOut> for ArrangerView<'a> {
|
||||||
let ins = |x|Bsp::s(self.inputs(), x);
|
let ins = |x|Bsp::s(self.inputs(), x);
|
||||||
let tracks = |x|Bsp::s(self.tracks(), x);
|
let tracks = |x|Bsp::s(self.tracks(), x);
|
||||||
let outs = |x|Bsp::n(self.outputs(), x);
|
let outs = |x|Bsp::n(self.outputs(), x);
|
||||||
let bg = |x|Tui::bg(Reset, x);
|
let bg = |x|Tui::bg(Green, x);
|
||||||
let track_scroll = |x|Bsp::s(&self.track_scroll, x);
|
//let track_scroll = |x|Bsp::s(&self.track_scroll, x);
|
||||||
let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
|
//let scene_scroll = |x|Bsp::e(&self.scene_scroll, x);
|
||||||
ins(scene_scroll(track_scroll(tracks(outs(bg(self.scenes()))))))
|
ins(tracks(outs(bg(self.scenes()))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,13 +68,13 @@ impl<'a> ArrangerView<'a> {
|
||||||
outputs_height: app.h_outputs().saturating_sub(1),
|
outputs_height: app.h_outputs().saturating_sub(1),
|
||||||
outputs_count: app.midi_outs.len(),
|
outputs_count: app.midi_outs.len(),
|
||||||
|
|
||||||
scenes_height: app.h_tracks_area(),
|
scenes_height: app.h_scenes_area(),
|
||||||
scene_selected: app.selected().scene(),
|
scene_selected: app.selected().scene(),
|
||||||
scene_count: app.scenes.len(),
|
scene_count: app.scenes.len(),
|
||||||
scene_last: app.scenes.len().saturating_sub(1),
|
scene_last: app.scenes.len().saturating_sub(1),
|
||||||
scene_scroll: Fill::y(Fixed::x(1, ScrollbarV {
|
scene_scroll: Fill::y(Fixed::x(1, ScrollbarV {
|
||||||
offset: app.scene_scroll,
|
offset: app.scene_scroll,
|
||||||
length: app.h_tracks_area() as usize,
|
length: app.h_scenes_area() as usize,
|
||||||
total: app.h_scenes() 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(),
|
//":scene-add" => self.view_scene_add().boxed(),
|
||||||
//":scenes" => self.view_scenes().boxed(),
|
//":scenes" => self.view_scenes().boxed(),
|
||||||
//":tracks" => self.view_tracks().boxed(),
|
//":tracks" => self.view_tracks().boxed(),
|
||||||
|
":nil" => Box::new("nil"),
|
||||||
":transport" => self.view_transport().boxed(),
|
":transport" => self.view_transport().boxed(),
|
||||||
":arranger" => ArrangerView::new(self).boxed(),
|
":arranger" => ArrangerView::new(self).boxed(),
|
||||||
":editor" => self.editor.as_ref().map(|e|Bsp::e(e.clip_status(), e.edit_status())).boxed(),
|
":editor" => self.editor.as_ref().map(|e|Bsp::e(e.clip_status(), e.edit_status())).boxed(),
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,14 @@ impl Tek {
|
||||||
pub(crate) fn h (&self) -> u16 {
|
pub(crate) fn h (&self) -> u16 {
|
||||||
self.size.h() as 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 {
|
pub(crate) fn h_tracks_area (&self) -> u16 {
|
||||||
|
//5
|
||||||
self.h().saturating_sub(self.h_inputs() + self.h_outputs())
|
self.h().saturating_sub(self.h_inputs() + self.h_outputs())
|
||||||
}
|
}
|
||||||
/// Height available to display tracks.
|
/// Height available to display tracks.
|
||||||
pub(crate) fn h_scenes_area (&self) -> u16 {
|
pub(crate) fn h_scenes_area (&self) -> u16 {
|
||||||
|
//15
|
||||||
self.h().saturating_sub(self.h_tracks_area())
|
self.h().saturating_sub(self.h_tracks_area())
|
||||||
}
|
}
|
||||||
/// Height taken by all inputs.
|
/// Height taken by all inputs.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue