mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 20:26:42 +01:00
update docs and extract handle_modal
This commit is contained in:
parent
81ea049773
commit
f49615d598
9 changed files with 27 additions and 23 deletions
|
|
@ -4,13 +4,8 @@ use crate::{core::*, handle, App, AppFocus};
|
|||
|
||||
handle!{
|
||||
App |self, e| {
|
||||
if let Some(ref mut modal) = self.modal {
|
||||
if modal.handle(e)? {
|
||||
if modal.exited() {
|
||||
self.modal = None;
|
||||
}
|
||||
return Ok(true)
|
||||
};
|
||||
if handle_modal(self, e)? {
|
||||
return Ok(true)
|
||||
}
|
||||
Ok(if self.entered {
|
||||
handle_focused(self, e)?
|
||||
|
|
@ -24,6 +19,18 @@ handle!{
|
|||
}
|
||||
}
|
||||
|
||||
fn handle_modal (state: &mut App, e: &AppEvent) -> Usually<bool> {
|
||||
if let Some(ref mut modal) = state.modal {
|
||||
if modal.handle(e)? {
|
||||
if modal.exited() {
|
||||
state.modal = None;
|
||||
}
|
||||
return Ok(true)
|
||||
};
|
||||
}
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
fn handle_focused (state: &mut App, e: &AppEvent) -> Usually<bool> {
|
||||
match state.section {
|
||||
AppFocus::Transport =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue