text: render text asynchronously
This commit is contained in:
parent
d9eb14e2bc
commit
12f358c0d9
12 changed files with 893 additions and 421 deletions
18
src/utils/on_drop_event.rs
Normal file
18
src/utils/on_drop_event.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use {crate::utils::asyncevent::AsyncEvent, std::rc::Rc};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct OnDropEvent {
|
||||
ae: Rc<AsyncEvent>,
|
||||
}
|
||||
|
||||
impl OnDropEvent {
|
||||
pub fn event(&self) -> Rc<AsyncEvent> {
|
||||
self.ae.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for OnDropEvent {
|
||||
fn drop(&mut self) {
|
||||
self.ae.trigger()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue