mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
arranger: trying to fix width
This commit is contained in:
parent
03024f8a14
commit
2013bac62f
3 changed files with 11 additions and 32 deletions
|
|
@ -64,7 +64,7 @@ impl Arrangement {
|
|||
}
|
||||
/// Width available to display tracks.
|
||||
pub fn w_tracks_area (&self, is_editing: bool) -> u16 {
|
||||
self.w().saturating_sub(2 * self.w_sidebar(is_editing))
|
||||
self.w().saturating_sub(self.w_sidebar(is_editing))
|
||||
}
|
||||
/// Height of display
|
||||
pub fn h (&self) -> u16 {
|
||||
|
|
@ -77,13 +77,7 @@ impl Arrangement {
|
|||
}
|
||||
/// Height available to display tracks.
|
||||
pub fn h_scenes_area (&self) -> u16 {
|
||||
//15
|
||||
self.h().saturating_sub(
|
||||
self.h_inputs() +
|
||||
self.h_outputs() +
|
||||
self.h_devices() +
|
||||
13 // FIXME
|
||||
)
|
||||
20 // FIXME
|
||||
}
|
||||
/// Height taken by all scenes.
|
||||
pub fn h_scenes (&self, is_editing: bool) -> u16 {
|
||||
|
|
|
|||
|
|
@ -2,26 +2,19 @@ use crate::*;
|
|||
|
||||
pub struct ArrangerView<'a> {
|
||||
pub arrangement: &'a Arrangement,
|
||||
|
||||
pub is_editing: bool,
|
||||
|
||||
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>,
|
||||
pub scenes_height: u16,
|
||||
|
||||
pub track_scroll: Fill<Fixed<u16, ScrollbarH>>,
|
||||
pub track_selected: Option<usize>,
|
||||
pub tracks_height: u16,
|
||||
|
||||
pub show_debug_info: bool,
|
||||
}
|
||||
|
||||
impl<'a> ArrangerView<'a> {
|
||||
|
|
@ -36,14 +29,11 @@ impl<'a> ArrangerView<'a> {
|
|||
Self {
|
||||
arrangement,
|
||||
is_editing,
|
||||
|
||||
width: arrangement.w(),
|
||||
width_mid: arrangement.w_tracks_area(is_editing),
|
||||
width_side: arrangement.w_sidebar(is_editing),
|
||||
|
||||
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),
|
||||
|
|
@ -52,7 +42,6 @@ impl<'a> ArrangerView<'a> {
|
|||
length: h_scenes_area as usize,
|
||||
total: h_scenes as usize,
|
||||
})),
|
||||
|
||||
tracks_height: h_tracks_area,
|
||||
track_selected: arrangement.selection().track(),
|
||||
track_scroll: Fill::x(Fixed::y(1, ScrollbarH {
|
||||
|
|
@ -60,8 +49,6 @@ impl<'a> ArrangerView<'a> {
|
|||
length: h_tracks_area as usize,
|
||||
total: h_scenes as usize,
|
||||
})),
|
||||
|
||||
show_debug_info: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -148,7 +135,6 @@ impl<'a> ArrangerView<'a> {
|
|||
scenes_height, scene_last, scene_selected,
|
||||
track_selected, is_editing, ..
|
||||
} = self;
|
||||
|
||||
let selection = Has::<Selection>::get(self.arrangement);
|
||||
let selected_track = selection.track();
|
||||
let selected_scene = selection.scene();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue