mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-08-28 12:56:57 +02:00
add Exit trait to modals
This commit is contained in:
parent
0cc8d88e5f
commit
33e5f47526
6 changed files with 67 additions and 33 deletions
|
|
@ -47,7 +47,7 @@ impl AppPaths {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct SetupModal(pub Option<Arc<XdgApp>>);
|
||||
pub struct SetupModal(pub Option<Arc<XdgApp>>, pub bool);
|
||||
|
||||
render!(SetupModal |self, buf, area| {
|
||||
for cell in buf.content.iter_mut() {
|
||||
|
|
@ -83,9 +83,17 @@ handle!(SetupModal |self, e| {
|
|||
..
|
||||
})) = e {
|
||||
AppPaths::new(&self.0.as_ref().unwrap())?.create()?;
|
||||
self.0 = None;
|
||||
self.exit();
|
||||
Ok(true)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
});
|
||||
impl Exit for SetupModal {
|
||||
fn exited (&self) -> bool {
|
||||
self.1
|
||||
}
|
||||
fn exit (&mut self) {
|
||||
self.1 = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue