mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-07-17 15:56:57 +02:00
restruct: 30e
This commit is contained in:
parent
8b6ab2fd08
commit
c737c7d839
13 changed files with 771 additions and 747 deletions
11
src/app.rs
11
src/app.rs
|
|
@ -87,11 +87,11 @@ impl App {
|
|||
|
||||
pub fn new_shared_run (
|
||||
exit: &Exit, jack: &Jack<'static>, project: Arrangement, config: Config, mode: impl AsRef<str>
|
||||
) -> Usually<(Task, Task)> {
|
||||
) -> Usually<(Self, Task, Task)> {
|
||||
let state = Self::new_shared(&jack, project, config, mode);
|
||||
let keyboard = tui_input(&exit, &state, Duration::from_millis(100))?;
|
||||
let terminal = tui_output(&exit, &state, Duration::from_millis(10))?;
|
||||
Ok((keyboard, terminal))
|
||||
Ok((state, keyboard, terminal))
|
||||
}
|
||||
|
||||
pub fn confirm (&mut self) -> Perhaps<AppCommand> {
|
||||
|
|
@ -361,10 +361,10 @@ impl HasJack<'static> for App {
|
|||
|
||||
def_command!(AppCommand: |app: App| {
|
||||
Nop => Ok(None),
|
||||
Confirm => tek_confirm(app),
|
||||
Cancel => todo!(), // TODO delegate:
|
||||
Inc { axis: ControlAxis } => tek_inc(app, axis),
|
||||
Dec { axis: ControlAxis } => tek_dec(app, axis),
|
||||
Confirm => app.confirm(),
|
||||
Inc { axis: ControlAxis } => app.inc(axis),
|
||||
Dec { axis: ControlAxis } => app.dec(axis),
|
||||
SetDialog { dialog: Dialog } => {
|
||||
swap_value(&mut app.dialog, dialog, |dialog|Self::SetDialog { dialog })
|
||||
},
|
||||
|
|
@ -536,6 +536,7 @@ fn app_interpret_word (state: &App, to: &mut Tui, dsl: &impl Expression) -> Usua
|
|||
h_exact(2, origin_n(w_full(item)))
|
||||
)));
|
||||
}
|
||||
Ok(to.area().into())
|
||||
})))
|
||||
} else {
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue