From bbd9355450bc2df3a2c0e37cc900ba00b26255af Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 29 Nov 2021 16:22:01 +0700 Subject: Introduce `Shell` type in `iced_native` Widgets now can invalidate the current layout of the application on demand. --- native/src/widget/radio.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'native/src/widget/radio.rs') diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs index 86ad4c4e..523773bd 100644 --- a/native/src/widget/radio.rs +++ b/native/src/widget/radio.rs @@ -11,7 +11,7 @@ use crate::touch; use crate::widget::{self, Row, Text}; use crate::{ Alignment, Clipboard, Color, Element, Hasher, Layout, Length, Point, - Rectangle, Widget, + Rectangle, Shell, Widget, }; pub use iced_style::radio::{Style, StyleSheet}; @@ -187,13 +187,13 @@ where cursor_position: Point, _renderer: &Renderer, _clipboard: &mut dyn Clipboard, - messages: &mut Vec, + shell: &mut Shell<'_, Message>, ) -> event::Status { match event { Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) | Event::Touch(touch::Event::FingerPressed { .. }) => { if layout.bounds().contains(cursor_position) { - messages.push(self.on_click.clone()); + shell.publish(self.on_click.clone()); return event::Status::Captured; } -- cgit