mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +02:00
tek_has
This commit is contained in:
parent
0a89fab28a
commit
9e3cc1139d
18 changed files with 450 additions and 414 deletions
|
|
@ -600,18 +600,6 @@ impl OctaveVertical {
|
|||
|
||||
impl HasClipsSize for App { fn clips_size (&self) -> &Sizer { &self.project.size_inner } }
|
||||
impl HasClipsSize for Project { fn clips_size (&self) -> &Sizer { &self.size_inner } }
|
||||
pub trait HasClipsSize {
|
||||
/// Size of clips area.
|
||||
fn clips_size (&self) -> &Sizer;
|
||||
/// Draw content annotated with value of [Self::clips_size].
|
||||
fn with_clips_size (&self, show: bool, content: impl Draw<Tui>) -> impl Draw<Tui> {
|
||||
let size = self.clips_size();
|
||||
above(
|
||||
when(show, fg(Green, east!(size.w() as usize, "x", size.h() as usize)).align_se()),
|
||||
size.of(content.align_c().full_wh())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl MidiEditor {
|
||||
pub fn clip_status (&self) -> impl Draw<Tui> + '_ {
|
||||
|
|
@ -668,6 +656,8 @@ impl<T> TracksView for T where T:
|
|||
pub trait TracksView:
|
||||
HasTracks + ScenesView + HasMidiIns + HasMidiOuts + HasTrack
|
||||
{
|
||||
/// Spacing between tracks.
|
||||
const TRACK_SPACING: usize = 0;
|
||||
|
||||
/// Iterate over tracks with their corresponding sizes.
|
||||
fn tracks_with_sizes (&self) -> impl TracksSizes<'_> {
|
||||
|
|
@ -880,7 +870,7 @@ pub trait ScenesView: HasEditor + HasSelection + HasSceneScroll + HasClipsSize +
|
|||
fn w_side (&self) -> u16;
|
||||
fn w_mid (&self) -> u16;
|
||||
|
||||
fn view_scenes_names (&self) -> impl Draw<Tui> {
|
||||
fn view_scenes_names (&self) -> impl Draw<Tui> where Self: Sized {
|
||||
let select = self.selection();
|
||||
let editor = self.editor();
|
||||
let editing = self.is_editing();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue