mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16: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
|
|
@ -41,6 +41,14 @@ pub trait Component: Render + Handle + Sync {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait Exit: Component {
|
||||
fn exited (&self) -> bool;
|
||||
fn exit (&mut self);
|
||||
fn boxed (self) -> Box<dyn Exit> where Self: Sized + 'static {
|
||||
Box::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
/// Anything that implements `Render` + `Handle` can be used as a UI component.
|
||||
impl<T: Render + Handle + Sync> Component for T {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue