From dcc184b01b753dbecb500205391f6eaaa21c8683 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 25 Oct 2024 19:28:18 +0200 Subject: Replace `event::Status` in `Widget::on_event` with `Shell::capture_event` --- widget/src/container.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'widget/src/container.rs') diff --git a/widget/src/container.rs b/widget/src/container.rs index f4993ac9..f96c495c 100644 --- a/widget/src/container.rs +++ b/widget/src/container.rs @@ -21,7 +21,6 @@ //! ``` use crate::core::alignment::{self, Alignment}; use crate::core::border::{self, Border}; -use crate::core::event::{self, Event}; use crate::core::gradient::{self, Gradient}; use crate::core::layout; use crate::core::mouse; @@ -30,7 +29,7 @@ use crate::core::renderer; use crate::core::widget::tree::{self, Tree}; use crate::core::widget::{self, Operation}; use crate::core::{ - self, color, Background, Clipboard, Color, Element, Layout, Length, + self, color, Background, Clipboard, Color, Element, Event, Layout, Length, Padding, Pixels, Point, Rectangle, Shadow, Shell, Size, Theme, Vector, Widget, }; @@ -308,7 +307,7 @@ where clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, - ) -> event::Status { + ) { self.content.as_widget_mut().on_event( tree, event, @@ -318,7 +317,7 @@ where clipboard, shell, viewport, - ) + ); } fn mouse_interaction( -- cgit From f02bfc3f68322bea0c56283d76888714be401ec2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 25 Oct 2024 22:06:06 +0200 Subject: Rename `Widget::on_event` to `update` --- widget/src/container.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'widget/src/container.rs') diff --git a/widget/src/container.rs b/widget/src/container.rs index f96c495c..b7b2b39e 100644 --- a/widget/src/container.rs +++ b/widget/src/container.rs @@ -297,7 +297,7 @@ where ); } - fn on_event( + fn update( &mut self, tree: &mut Tree, event: Event, @@ -308,7 +308,7 @@ where shell: &mut Shell<'_, Message>, viewport: &Rectangle, ) { - self.content.as_widget_mut().on_event( + self.content.as_widget_mut().update( tree, event, layout.children().next().unwrap(), -- cgit