Merge pull request #668 from hecrj/fix/propagate-button-events
Propagate `Button` events to contents
This commit is contained in:
commit
86361f003c
@ -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 { .. }) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user