mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
arranger (sorta. sizing woes)
This commit is contained in:
parent
2013bac62f
commit
182107bfa5
4 changed files with 8 additions and 19 deletions
|
|
@ -6,14 +6,14 @@ pub struct ArrangerView<'a> {
|
|||
pub width: u16,
|
||||
pub width_mid: u16,
|
||||
pub width_side: u16,
|
||||
pub inputs_height: u16,
|
||||
pub outputs_height: u16,
|
||||
pub scene_last: usize,
|
||||
pub scene_scroll: Fill<Fixed<u16, ScrollbarV>>,
|
||||
pub scene_selected: Option<usize>,
|
||||
/// Height available to display scene/track content.
|
||||
pub scenes_height: u16,
|
||||
pub track_scroll: Fill<Fixed<u16, ScrollbarH>>,
|
||||
pub track_selected: Option<usize>,
|
||||
/// Height available to display track headers.
|
||||
pub tracks_height: u16,
|
||||
}
|
||||
|
||||
|
|
@ -23,8 +23,8 @@ impl<'a> ArrangerView<'a> {
|
|||
editor: Option<&'a MidiEditor>
|
||||
) -> Self {
|
||||
let is_editing = editor.is_some();
|
||||
let h_tracks_area = arrangement.h_tracks_area();
|
||||
let h_scenes_area = arrangement.h_scenes_area();
|
||||
let h_tracks_area = 5;
|
||||
let h_scenes_area = (arrangement.height() as u16).saturating_sub(50);
|
||||
let h_scenes = arrangement.h_scenes(is_editing);
|
||||
Self {
|
||||
arrangement,
|
||||
|
|
@ -32,8 +32,6 @@ impl<'a> ArrangerView<'a> {
|
|||
width: arrangement.w_tracks_area(is_editing),
|
||||
width_mid: arrangement.w_tracks_area(is_editing).saturating_sub(20),
|
||||
width_side: 20,
|
||||
inputs_height: arrangement.h_inputs(),
|
||||
outputs_height: arrangement.h_outputs(),
|
||||
scenes_height: h_scenes_area,
|
||||
scene_selected: arrangement.selection().scene(),
|
||||
scene_last: arrangement.scenes.len().saturating_sub(1),
|
||||
|
|
@ -62,7 +60,7 @@ impl<'a> Content<TuiOut> for ArrangerView<'a> {
|
|||
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);
|
||||
outs(tracks(devices(ins(bg(self.scenes(&None))))))
|
||||
self.arrangement.size.of(outs(tracks(devices(ins(bg(self.scenes(&None)))))))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue