diff options
Diffstat (limited to 'widget/src/button.rs')
-rw-r--r-- | widget/src/button.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/widget/src/button.rs b/widget/src/button.rs index d1fa9302..da459623 100644 --- a/widget/src/button.rs +++ b/widget/src/button.rs @@ -315,7 +315,7 @@ where } Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) | Event::Touch(touch::Event::FingerLifted { .. }) => { - if let Some(on_press) = self.on_press.as_ref().map(OnPress::get) + if let Some(on_press) = &self.on_press { let state = tree.state.downcast_mut::<State>(); @@ -325,7 +325,7 @@ where let bounds = layout.bounds(); if cursor.is_over(bounds) { - shell.publish(on_press); + shell.publish(on_press.get()); } shell.capture_event(); |