mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: p.53, e=118, fixed focus trait loop
This commit is contained in:
parent
9b996878c2
commit
76af9d9bac
15 changed files with 737 additions and 727 deletions
|
|
@ -45,6 +45,7 @@ impl TransportFocus {
|
|||
Self::Quant => Self::Sync,
|
||||
Self::Sync => Self::Clock,
|
||||
Self::Clock => Self::PlayPause,
|
||||
Self::Menu => { todo!() },
|
||||
}
|
||||
}
|
||||
pub fn prev (&mut self) {
|
||||
|
|
@ -54,6 +55,7 @@ impl TransportFocus {
|
|||
Self::Quant => Self::Bpm,
|
||||
Self::Sync => Self::Quant,
|
||||
Self::Clock => Self::Sync,
|
||||
Self::Menu => { todo!() },
|
||||
}
|
||||
}
|
||||
pub fn wrap <'a, W: Widget<Engine = Tui>> (
|
||||
|
|
@ -66,9 +68,9 @@ impl TransportFocus {
|
|||
}
|
||||
}
|
||||
|
||||
impl HasFocus for TransportTui {
|
||||
type Item = TransportFocus;
|
||||
}
|
||||
//impl HasFocus for TransportTui {
|
||||
//type Item = TransportFocus;
|
||||
//}
|
||||
|
||||
impl FocusEnter for TransportTui {
|
||||
type Item = TransportFocus;
|
||||
|
|
@ -107,9 +109,9 @@ impl FocusGrid for TransportTui {
|
|||
}
|
||||
}
|
||||
|
||||
impl HasFocus for SequencerTui {
|
||||
type Item = SequencerFocus;
|
||||
}
|
||||
//impl HasFocus for SequencerTui {
|
||||
//type Item = SequencerFocus;
|
||||
//}
|
||||
|
||||
impl FocusEnter for SequencerTui {
|
||||
type Item = SequencerFocus;
|
||||
|
|
@ -163,15 +165,15 @@ impl FocusEnter for ArrangerTui {
|
|||
let focused = self.focused();
|
||||
if !self.entered {
|
||||
self.entered = focused == Arranger;
|
||||
self.app.editor.entered = focused == PhraseEditor;
|
||||
self.app.phrases.entered = focused == PhrasePool;
|
||||
self.editor.entered = focused == PhraseEditor;
|
||||
self.phrases.entered = focused == PhrasePool;
|
||||
}
|
||||
}
|
||||
fn focus_exit (&mut self) {
|
||||
if self.entered {
|
||||
self.entered = false;
|
||||
self.app.editor.entered = false;
|
||||
self.app.phrases.entered = false;
|
||||
self.editor.entered = false;
|
||||
self.phrases.entered = false;
|
||||
}
|
||||
}
|
||||
fn focus_entered (&self) -> Option<Self::Item> {
|
||||
|
|
@ -207,7 +209,7 @@ impl FocusGrid for ArrangerTui {
|
|||
if let Some(mut status_bar) = self.status_bar {
|
||||
status_bar.update(&(
|
||||
self.focused(),
|
||||
self.app.selected,
|
||||
self.selected,
|
||||
focused == PhraseEditor && self.entered
|
||||
))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue