mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +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
|
|
@ -17,10 +17,9 @@
|
||||||
(layer "./keys_arranger.edn")
|
(layer "./keys_arranger.edn")
|
||||||
(layer "./keys_global.edn"))
|
(layer "./keys_global.edn"))
|
||||||
|
|
||||||
(view
|
(view (bsp/a :view-dialog
|
||||||
(bsp/a :view-dialog
|
(bsp/e
|
||||||
(bsp/s (fixed/y 1 :view-transport)
|
(fill/y (align/n (bsp/s :view-status-v (bsp/s
|
||||||
(bsp/n (fixed/y 1 :view-status)
|
(bsp/s :view-midi-ports-status :view-audio-ports-status)
|
||||||
(fill/xy (bsp/a
|
(bsp/n :view-editor-status :view-pool)))))
|
||||||
(fill/xy (align/e :view-pool))
|
:view-arranger)))
|
||||||
:view-arranger))))))
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ impl Arrangement {
|
||||||
}
|
}
|
||||||
/// Width available to display tracks.
|
/// Width available to display tracks.
|
||||||
pub fn w_tracks_area (&self, is_editing: bool) -> u16 {
|
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
|
/// Height of display
|
||||||
pub fn h (&self) -> u16 {
|
pub fn h (&self) -> u16 {
|
||||||
|
|
@ -77,13 +77,7 @@ impl Arrangement {
|
||||||
}
|
}
|
||||||
/// Height available to display tracks.
|
/// Height available to display tracks.
|
||||||
pub fn h_scenes_area (&self) -> u16 {
|
pub fn h_scenes_area (&self) -> u16 {
|
||||||
//15
|
20 // FIXME
|
||||||
self.h().saturating_sub(
|
|
||||||
self.h_inputs() +
|
|
||||||
self.h_outputs() +
|
|
||||||
self.h_devices() +
|
|
||||||
13 // FIXME
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
/// Height taken by all scenes.
|
/// Height taken by all scenes.
|
||||||
pub fn h_scenes (&self, is_editing: bool) -> u16 {
|
pub fn h_scenes (&self, is_editing: bool) -> u16 {
|
||||||
|
|
|
||||||
|
|
@ -2,26 +2,19 @@ use crate::*;
|
||||||
|
|
||||||
pub struct ArrangerView<'a> {
|
pub struct ArrangerView<'a> {
|
||||||
pub arrangement: &'a Arrangement,
|
pub arrangement: &'a Arrangement,
|
||||||
|
|
||||||
pub is_editing: bool,
|
pub is_editing: bool,
|
||||||
|
|
||||||
pub width: u16,
|
pub width: u16,
|
||||||
pub width_mid: u16,
|
pub width_mid: u16,
|
||||||
pub width_side: u16,
|
pub width_side: u16,
|
||||||
|
|
||||||
pub inputs_height: u16,
|
pub inputs_height: u16,
|
||||||
pub outputs_height: u16,
|
pub outputs_height: u16,
|
||||||
|
|
||||||
pub scene_last: usize,
|
pub scene_last: usize,
|
||||||
pub scene_scroll: Fill<Fixed<u16, ScrollbarV>>,
|
pub scene_scroll: Fill<Fixed<u16, ScrollbarV>>,
|
||||||
pub scene_selected: Option<usize>,
|
pub scene_selected: Option<usize>,
|
||||||
pub scenes_height: u16,
|
pub scenes_height: u16,
|
||||||
|
|
||||||
pub track_scroll: Fill<Fixed<u16, ScrollbarH>>,
|
pub track_scroll: Fill<Fixed<u16, ScrollbarH>>,
|
||||||
pub track_selected: Option<usize>,
|
pub track_selected: Option<usize>,
|
||||||
pub tracks_height: u16,
|
pub tracks_height: u16,
|
||||||
|
|
||||||
pub show_debug_info: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> ArrangerView<'a> {
|
impl<'a> ArrangerView<'a> {
|
||||||
|
|
@ -36,14 +29,11 @@ impl<'a> ArrangerView<'a> {
|
||||||
Self {
|
Self {
|
||||||
arrangement,
|
arrangement,
|
||||||
is_editing,
|
is_editing,
|
||||||
|
width: arrangement.w_tracks_area(is_editing),
|
||||||
width: arrangement.w(),
|
width_mid: arrangement.w_tracks_area(is_editing).saturating_sub(20),
|
||||||
width_mid: arrangement.w_tracks_area(is_editing),
|
width_side: 20,
|
||||||
width_side: arrangement.w_sidebar(is_editing),
|
|
||||||
|
|
||||||
inputs_height: arrangement.h_inputs(),
|
inputs_height: arrangement.h_inputs(),
|
||||||
outputs_height: arrangement.h_outputs(),
|
outputs_height: arrangement.h_outputs(),
|
||||||
|
|
||||||
scenes_height: h_scenes_area,
|
scenes_height: h_scenes_area,
|
||||||
scene_selected: arrangement.selection().scene(),
|
scene_selected: arrangement.selection().scene(),
|
||||||
scene_last: arrangement.scenes.len().saturating_sub(1),
|
scene_last: arrangement.scenes.len().saturating_sub(1),
|
||||||
|
|
@ -52,7 +42,6 @@ impl<'a> ArrangerView<'a> {
|
||||||
length: h_scenes_area as usize,
|
length: h_scenes_area as usize,
|
||||||
total: h_scenes as usize,
|
total: h_scenes as usize,
|
||||||
})),
|
})),
|
||||||
|
|
||||||
tracks_height: h_tracks_area,
|
tracks_height: h_tracks_area,
|
||||||
track_selected: arrangement.selection().track(),
|
track_selected: arrangement.selection().track(),
|
||||||
track_scroll: Fill::x(Fixed::y(1, ScrollbarH {
|
track_scroll: Fill::x(Fixed::y(1, ScrollbarH {
|
||||||
|
|
@ -60,8 +49,6 @@ impl<'a> ArrangerView<'a> {
|
||||||
length: h_tracks_area as usize,
|
length: h_tracks_area as usize,
|
||||||
total: h_scenes 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,
|
scenes_height, scene_last, scene_selected,
|
||||||
track_selected, is_editing, ..
|
track_selected, is_editing, ..
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
let selection = Has::<Selection>::get(self.arrangement);
|
let selection = Has::<Selection>::get(self.arrangement);
|
||||||
let selected_track = selection.track();
|
let selected_track = selection.track();
|
||||||
let selected_scene = selection.scene();
|
let selected_scene = selection.scene();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue