diff options
author | 2021-11-29 16:22:01 +0700 | |
---|---|---|
committer | 2021-11-29 16:22:01 +0700 | |
commit | bbd9355450bc2df3a2c0e37cc900ba00b26255af (patch) | |
tree | a6cf758c934638e3dd9586781dfb62e1cf028572 /native/src/widget/radio.rs | |
parent | f7792d89d64c39cdde9da030bec80fb6f461a0e3 (diff) | |
download | iced-bbd9355450bc2df3a2c0e37cc900ba00b26255af.tar.gz iced-bbd9355450bc2df3a2c0e37cc900ba00b26255af.tar.bz2 iced-bbd9355450bc2df3a2c0e37cc900ba00b26255af.zip |
Introduce `Shell` type in `iced_native`
Widgets now can invalidate the current layout of the application on demand.
Diffstat (limited to 'native/src/widget/radio.rs')
-rw-r--r-- | native/src/widget/radio.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Message>, + 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; } |