diff options
author | 2023-07-15 10:04:25 -0700 | |
---|---|---|
committer | 2023-07-15 10:04:25 -0700 | |
commit | 42c423b4a89613c4e1c552c891c1391a34837122 (patch) | |
tree | cd724464d59619f63ea24a0476cb342b0eca4caa /examples/toast | |
parent | e462f48a5a0b5023c3ca52e23698f5e9b25d86dd (diff) | |
download | iced-42c423b4a89613c4e1c552c891c1391a34837122.tar.gz iced-42c423b4a89613c4e1c552c891c1391a34837122.tar.bz2 iced-42c423b4a89613c4e1c552c891c1391a34837122.zip |
Add viewport to Widget::on_event
Diffstat (limited to 'examples/toast')
-rw-r--r-- | examples/toast/src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs index 4282ddcf..5d29e895 100644 --- a/examples/toast/src/main.rs +++ b/examples/toast/src/main.rs @@ -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() { |