summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-12-18 23:30:49 +0100
committerLibravatar GitHub <noreply@github.com>2020-12-18 23:30:49 +0100
commit86361f003caa1563392dd2ba46c3468f91995c61 (patch)
tree58af7d1bed5c807dafb529e38d7e5227e82a420b /native
parent0e9f649cb741d7f02c4bafe4ea804bd68e0a1b7a (diff)
parent8fb0ede72ef9ae4e40ae5bb32ae3e2415d4749c2 (diff)
downloadiced-86361f003caa1563392dd2ba46c3468f91995c61.tar.gz
iced-86361f003caa1563392dd2ba46c3468f91995c61.tar.bz2
iced-86361f003caa1563392dd2ba46c3468f91995c61.zip
Merge pull request #668 from hecrj/fix/propagate-button-events
Propagate `Button` events to contents
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/button.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs
index 8e2450de..b8c14634 100644
--- a/native/src/widget/button.rs
+++ b/native/src/widget/button.rs
@@ -161,9 +161,20 @@ where
layout: Layout<'_>,
cursor_position: Point,
messages: &mut Vec<Message>,
- _renderer: &Renderer,
- _clipboard: Option<&dyn Clipboard>,
+ renderer: &Renderer,
+ clipboard: Option<&dyn Clipboard>,
) -> 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 {
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
| Event::Touch(touch::Event::FingerPressed { .. }) => {