mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
use TuiInput in handlers
This commit is contained in:
parent
d9535b707f
commit
5d00e9f284
11 changed files with 37 additions and 61 deletions
|
|
@ -219,7 +219,7 @@ impl ArrangerFocus {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for Arranger<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
if let Some(modal) = self.modal.as_mut() {
|
||||
let result = modal.handle(from)?;
|
||||
if modal.exited() {
|
||||
|
|
@ -893,7 +893,7 @@ impl Widget for ArrangerRenameModal<Tui> {
|
|||
}
|
||||
|
||||
impl Handle<Tui> for ArrangerRenameModal<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
TuiEvent::Input(Event::Key(k)) => {
|
||||
match k.code {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ impl Content for ArrangerStandalone<Tui> {
|
|||
}
|
||||
|
||||
impl Handle<Tui> for ArrangerStandalone<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(' ')) => {
|
||||
if let Some(ref mut transport) = self.transport {
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ impl<'a> Widget for SequenceTimer<'a> {
|
|||
}
|
||||
|
||||
impl Handle<Tui> for Sequencer<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
// NONE, "seq_cursor_up", "move cursor up", |sequencer: &mut Sequencer| {
|
||||
key!(KeyCode::Up) => {
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ impl<E: Engine> Audio for TransportToolbar<E> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportToolbar<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Left) => {
|
||||
self.focus_prev();
|
||||
|
|
@ -249,7 +249,7 @@ impl Focusable<Tui> for TransportPlayPauseButton<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportPlayPauseButton<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Enter) => self.toggle().map(|_|Some(true)),
|
||||
_ => Ok(None)
|
||||
|
|
@ -293,7 +293,7 @@ impl Focusable<Tui> for TransportBPM<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportBPM<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => {
|
||||
self.value += 1.0;
|
||||
|
|
@ -355,7 +355,7 @@ impl Focusable<Tui> for TransportQuantize<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportQuantize<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => {
|
||||
self.value = prev_note_length(self.value);
|
||||
|
|
@ -408,7 +408,7 @@ impl Focusable<Tui> for TransportSync<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportSync<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => {
|
||||
self.value = prev_note_length(self.value);
|
||||
|
|
@ -464,7 +464,7 @@ impl Focusable<Tui> for TransportClock<Tui> {
|
|||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportClock<Tui> {
|
||||
fn handle (&mut self, from: &Tui) -> Perhaps<bool> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue