Make Widget::on_event return an event::Status

This commit is contained in:
Héctor Ramón Jiménez 2020-11-12 00:09:52 +01:00
parent 1db11ba69a
commit 3f968b8c87
20 changed files with 136 additions and 70 deletions

View file

@ -1,9 +1,9 @@
//! Distribute content horizontally.
use crate::event::{self, Event};
use crate::layout;
use crate::overlay;
use crate::{
Align, Clipboard, Element, Event, Hasher, Layout, Length, Point, Rectangle,
Widget,
Align, Clipboard, Element, Hasher, Layout, Length, Point, Rectangle, Widget,
};
use std::hash::Hash;
@ -162,19 +162,21 @@ where
messages: &mut Vec<Message>,
renderer: &Renderer,
clipboard: Option<&dyn Clipboard>,
) {
) -> event::Status {
self.children.iter_mut().zip(layout.children()).for_each(
|(child, layout)| {
child.widget.on_event(
let _ = child.widget.on_event(
event.clone(),
layout,
cursor_position,
messages,
renderer,
clipboard,
)
);
},
);
event::Status::Ignored
}
fn draw(