summaryrefslogtreecommitdiffstats
path: root/native/src/widget/radio.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-12 00:09:52 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-12 00:09:52 +0100
commit3f968b8c876b7c2351232856887fb9c3e3db3130 (patch)
tree0d8c04a09e2da877bb823bc039a57d4222fb1346 /native/src/widget/radio.rs
parent1db11ba69a3183924a1f4cae91031f4c5051b6dc (diff)
downloadiced-3f968b8c876b7c2351232856887fb9c3e3db3130.tar.gz
iced-3f968b8c876b7c2351232856887fb9c3e3db3130.tar.bz2
iced-3f968b8c876b7c2351232856887fb9c3e3db3130.zip
Make `Widget::on_event` return an `event::Status`
Diffstat (limited to '')
-rw-r--r--native/src/widget/radio.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs
index 06d3f846..6e74b404 100644
--- a/native/src/widget/radio.rs
+++ b/native/src/widget/radio.rs
@@ -1,8 +1,12 @@
//! Create choices using radio buttons.
+use crate::event::{self, Event};
+use crate::layout;
+use crate::mouse;
+use crate::row;
+use crate::text;
use crate::{
- layout, mouse, row, text, Align, Clipboard, Element, Event, Hasher,
- HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
- VerticalAlignment, Widget,
+ Align, Clipboard, Element, Hasher, HorizontalAlignment, Layout, Length,
+ Point, Rectangle, Row, Text, VerticalAlignment, Widget,
};
use std::hash::Hash;
@@ -166,7 +170,7 @@ where
messages: &mut Vec<Message>,
_renderer: &Renderer,
_clipboard: Option<&dyn Clipboard>,
- ) {
+ ) -> event::Status {
match event {
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
if layout.bounds().contains(cursor_position) {
@@ -175,6 +179,8 @@ where
}
_ => {}
}
+
+ event::Status::Ignored
}
fn draw(