diff --git a/crates/tek_tui/src/tui_view_arranger.rs b/crates/tek_tui/src/tui_view_arranger.rs index 6b048d41..5fc2cc6f 100644 --- a/crates/tek_tui/src/tui_view_arranger.rs +++ b/crates/tek_tui/src/tui_view_arranger.rs @@ -35,8 +35,8 @@ impl Content for ArrangerTui { ), Split::right( self.splits[1], - PhrasesView(self), - PhraseView2::from(self), + PhraseListView(self), + PhraseView::from(self), ) ) ) diff --git a/crates/tek_tui/src/tui_view_phrase_editor.rs b/crates/tek_tui/src/tui_view_phrase_editor.rs index 7bf8afef..809a2257 100644 --- a/crates/tek_tui/src/tui_view_phrase_editor.rs +++ b/crates/tek_tui/src/tui_view_phrase_editor.rs @@ -1,6 +1,6 @@ use crate::*; -pub struct PhraseView2<'a> { +pub struct PhraseView<'a> { pub(crate) focused: bool, pub(crate) entered: bool, pub(crate) phrase: &'a Option>>, @@ -13,7 +13,7 @@ pub struct PhraseView2<'a> { pub(crate) now: &'a Arc, } -impl<'a, T: HasEditor> From<&'a T> for PhraseView2<'a> { +impl<'a, T: HasEditor> From<&'a T> for PhraseView<'a> { fn from (state: &'a T) -> Self { Self { focused: state.editor_focused(), @@ -30,7 +30,7 @@ impl<'a, T: HasEditor> From<&'a T> for PhraseView2<'a> { } } -impl<'a> Content for PhraseView2<'a> { +impl<'a> Content for PhraseView<'a> { type Engine = Tui; fn content (&self) -> impl Widget { let Self { diff --git a/crates/tek_tui/src/tui_view_phrase_list.rs b/crates/tek_tui/src/tui_view_phrase_list.rs index 91ee0055..740e047f 100644 --- a/crates/tek_tui/src/tui_view_phrase_list.rs +++ b/crates/tek_tui/src/tui_view_phrase_list.rs @@ -3,17 +3,17 @@ use crate::*; impl Widget for PhrasesModel { type Engine = Tui; fn layout (&self, to: [u16;2]) -> Perhaps<[u16;2]> { - PhrasesView(self).layout(to) + PhraseListView(self).layout(to) } fn render (&self, to: &mut TuiOutput) -> Usually<()> { - PhrasesView(self).render(to) + PhraseListView(self).render(to) } } -pub struct PhrasesView<'a, T: PhrasesViewState>(pub &'a T); +pub struct PhraseListView<'a, T: PhraseListViewState>(pub &'a T); // TODO: Display phrases always in order of appearance -impl<'a, T: PhrasesViewState> Content for PhrasesView<'a, T> { +impl<'a, T: PhraseListViewState> Content for PhraseListView<'a, T> { type Engine = Tui; fn content (&self) -> impl Widget { let focused = self.0.phrases_focused(); @@ -72,7 +72,7 @@ impl<'a, T: PhrasesViewState> Content for PhrasesView<'a, T> { } } -pub trait PhrasesViewState: Send + Sync { +pub trait PhraseListViewState: Send + Sync { fn phrases_focused (&self) -> bool; fn phrases_entered (&self) -> bool; fn phrases (&self) -> &Vec>>; @@ -82,7 +82,7 @@ pub trait PhrasesViewState: Send + Sync { macro_rules! impl_phrases_view_state { ($Struct:ident $(:: $field:ident)* [$self1:ident: $focus:expr] [$self2:ident: $enter:expr]) => { - impl PhrasesViewState for $Struct { + impl PhraseListViewState for $Struct { fn phrases_focused (&$self1) -> bool { $focus } diff --git a/crates/tek_tui/src/tui_view_sequencer.rs b/crates/tek_tui/src/tui_view_sequencer.rs index 49aa7459..2e86a998 100644 --- a/crates/tek_tui/src/tui_view_sequencer.rs +++ b/crates/tek_tui/src/tui_view_sequencer.rs @@ -3,14 +3,12 @@ use crate::*; impl Content for SequencerTui { type Engine = Tui; fn content (&self) -> impl Widget { - SequencerStatusBar::with(self, lay!( - col!( - TransportView::from(self), - Split::right(20, - widget(&PhrasesView(self)), - widget(&PhraseView2::from(self)), - ).min_y(20) - ), + SequencerStatusBar::with(self, col!( + TransportView::from(self), + Split::right(20, + PhraseListView(self), + PhraseView::from(self), + ).min_y(20) )) } }