Propagate Button events to contents

This commit is contained in:
Héctor Ramón Jiménez 2020-12-18 09:40:10 +01:00
parent 07b570036a
commit 8fb0ede72e

View File

@ -161,9 +161,20 @@ where
layout: Layout<'_>, layout: Layout<'_>,
cursor_position: Point, cursor_position: Point,
messages: &mut Vec<Message>, messages: &mut Vec<Message>,
_renderer: &Renderer, renderer: &Renderer,
_clipboard: Option<&dyn Clipboard>, clipboard: Option<&dyn Clipboard>,
) -> event::Status { ) -> event::Status {
if let event::Status::Captured = self.content.on_event(
event.clone(),
layout.children().next().unwrap(),
cursor_position,
messages,
renderer,
clipboard,
) {
return event::Status::Captured;
}
match event { match event {
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
| Event::Touch(touch::Event::FingerPressed { .. }) => { | Event::Touch(touch::Event::FingerPressed { .. }) => {