Make Widget::on_event return an event::Status
This commit is contained in:
parent
1db11ba69a
commit
3f968b8c87
20 changed files with 136 additions and 70 deletions
|
|
@ -1,11 +1,11 @@
|
|||
//! Distribute content vertically.
|
||||
use std::hash::Hash;
|
||||
|
||||
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::u32;
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue