listener handles, auto-clean destroyed listeners, minor refactor

This commit is contained in:
Aleksander
2025-07-06 20:53:40 +02:00
parent 92444bb5c4
commit 857c5ec865
16 changed files with 348 additions and 182 deletions

View File

@@ -152,6 +152,9 @@ impl Layout {
widget::EventResult::Outside => {
iter_children = false;
}
widget::EventResult::Unused => {
iter_children = false;
}
}
}
@@ -186,7 +189,7 @@ impl Layout {
pub fn push_event<U1, U2>(
&mut self,
listeners: &EventListenerCollection<U1, U2>,
listeners: &mut EventListenerCollection<U1, U2>,
event: &event::Event,
mut user_data: (&mut U1, &mut U2),
) -> anyhow::Result<()> {
@@ -202,6 +205,8 @@ impl Layout {
self.process_alterables(alterables)?;
listeners.gc();
Ok(())
}