mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: big flat pt.8: wh -> xy
This commit is contained in:
parent
da25b28ebf
commit
e958b4a2d2
27 changed files with 117 additions and 117 deletions
20
src/focus.rs
20
src/focus.rs
|
|
@ -40,17 +40,16 @@ pub enum FocusCommand<T: Send + Sync> {
|
|||
|
||||
impl<F: HasFocus + HasEnter + FocusGrid + FocusOrder> Command<F> for FocusCommand<F::Item> {
|
||||
fn execute (self, state: &mut F) -> Perhaps<FocusCommand<F::Item>> {
|
||||
use FocusCommand::*;
|
||||
match self {
|
||||
Next => { state.focus_next(); },
|
||||
Prev => { state.focus_prev(); },
|
||||
Up => { state.focus_up(); },
|
||||
Down => { state.focus_down(); },
|
||||
Left => { state.focus_left(); },
|
||||
Right => { state.focus_right(); },
|
||||
Enter => { state.focus_enter(); },
|
||||
Exit => { state.focus_exit(); },
|
||||
Set(to) => { state.set_focused(to); },
|
||||
Self::Next => { state.focus_next(); },
|
||||
Self::Prev => { state.focus_prev(); },
|
||||
Self::Up => { state.focus_up(); },
|
||||
Self::Down => { state.focus_down(); },
|
||||
Self::Left => { state.focus_left(); },
|
||||
Self::Right => { state.focus_right(); },
|
||||
Self::Enter => { state.focus_enter(); },
|
||||
Self::Exit => { state.focus_exit(); },
|
||||
Self::Set(to) => { state.set_focused(to); },
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
|
|
@ -248,7 +247,6 @@ pub trait FocusWrap<T> {
|
|||
}
|
||||
|
||||
pub fn to_focus_command <T: Send + Sync> (input: &TuiInput) -> Option<FocusCommand<T>> {
|
||||
use KeyCode::{Tab, BackTab, Up, Down, Left, Right, Enter, Esc};
|
||||
Some(match input.event() {
|
||||
key_pat!(Tab) => FocusCommand::Next,
|
||||
key_pat!(Shift-Tab) => FocusCommand::Prev,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue