mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 20:26:42 +01:00
wip: refactor pt.5, no translate
This commit is contained in:
parent
8c37c95cc6
commit
5df08409e5
19 changed files with 389 additions and 457 deletions
|
|
@ -125,27 +125,3 @@ impl TransportToolbarFocus {
|
|||
lay!(corners, highlight, *widget)
|
||||
}
|
||||
}
|
||||
impl Handle<Tui> for TransportToolbar<Tui> {
|
||||
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
if let Some(command) = TransportCommand::input_to_command(self, from) {
|
||||
let _undo = command.execute(self)?;
|
||||
return Ok(Some(true))
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
impl InputToCommand<Tui, TransportToolbar<Tui>> for TransportCommand {
|
||||
fn input_to_command (_: &TransportToolbar<Tui>, input: &TuiInput) -> Option<Self> {
|
||||
match input.event() {
|
||||
key!(KeyCode::Char(' ')) => Some(Self::FocusPrev),
|
||||
key!(Shift-KeyCode::Char(' ')) => Some(Self::FocusPrev),
|
||||
key!(KeyCode::Left) => Some(Self::FocusPrev),
|
||||
key!(KeyCode::Right) => Some(Self::FocusNext),
|
||||
key!(KeyCode::Char('.')) => Some(Self::Increment),
|
||||
key!(KeyCode::Char(',')) => Some(Self::Decrement),
|
||||
key!(KeyCode::Char('>')) => Some(Self::FineIncrement),
|
||||
key!(KeyCode::Char('<')) => Some(Self::FineDecrement),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue