Add viewport to Widget::on_event

This commit is contained in:
Cory Forsstrom 2023-07-15 10:04:25 -07:00
parent e462f48a5a
commit 42c423b4a8
30 changed files with 77 additions and 5 deletions

View file

@ -400,6 +400,7 @@ mod toast {
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
) -> event::Status {
self.content.as_widget_mut().on_event(
&mut state.children[0],
@ -409,6 +410,7 @@ mod toast {
renderer,
clipboard,
shell,
viewport,
)
}
@ -559,6 +561,8 @@ mod toast {
}
}
let viewport = layout.bounds();
self.toasts
.iter_mut()
.zip(self.state.iter_mut())
@ -576,6 +580,7 @@ mod toast {
renderer,
clipboard,
&mut local_shell,
&viewport,
);
if !local_shell.is_empty() {