mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
working main menu
This commit is contained in:
parent
559d2fc4a1
commit
f81f16b47b
7 changed files with 130 additions and 80 deletions
|
|
@ -49,8 +49,15 @@ impl Default for AppCommand { fn default () -> Self { Self::Nop } }
|
|||
|
||||
def_command!(AppCommand: |app: App| {
|
||||
Nop => Ok(None),
|
||||
Confirm => todo!(),
|
||||
Cancel => todo!(), // TODO delegate:
|
||||
Confirm => Ok(match &app.dialog {
|
||||
Dialog::Menu(index, items) => {
|
||||
let callback = items.0[*index].1.clone();
|
||||
callback(app)?;
|
||||
None
|
||||
},
|
||||
_ => todo!(),
|
||||
}),
|
||||
Cancel => todo!(), // TODO delegate:
|
||||
Inc { axis: Axis } => Ok(match (&app.dialog, axis) {
|
||||
(Dialog::None, _) => todo!(),
|
||||
(Dialog::Menu(_, _), Axis::Y) => AppCommand::SetDialog { dialog: app.dialog.menu_next() }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue