mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 20:26:42 +01:00
add Exit trait to modals
This commit is contained in:
parent
0cc8d88e5f
commit
33e5f47526
6 changed files with 67 additions and 33 deletions
|
|
@ -6,7 +6,9 @@ handle!{
|
|||
App |self, e| {
|
||||
if let Some(ref mut modal) = self.modal {
|
||||
if modal.handle(e)? {
|
||||
self.modal = None;
|
||||
if modal.exited() {
|
||||
self.modal = None;
|
||||
}
|
||||
return Ok(true)
|
||||
};
|
||||
}
|
||||
|
|
@ -145,10 +147,12 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
|
|||
|
||||
fn focus_next (app: &mut App) -> Usually<bool> {
|
||||
app.section.next();
|
||||
app.transport.focused = app.section == AppSection::Transport;
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
fn focus_prev (app: &mut App) -> Usually<bool> {
|
||||
app.section.prev();
|
||||
app.transport.focused = app.section == AppSection::Transport;
|
||||
Ok(true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue