Merge pull request #1699 from nicksenger/overlay/is_over

Implement `is_over` for iced_lazy widget `Overlay`s
This commit is contained in:
Héctor Ramón 2023-02-14 06:32:05 +01:00 committed by GitHub
commit 2c680a3e5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View file

@ -563,4 +563,11 @@ where
event_status event_status
} }
fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
self.with_overlay_maybe(|overlay| {
overlay.is_over(layout, cursor_position)
})
.unwrap_or_default()
}
} }

View file

@ -372,6 +372,13 @@ where
}) })
.unwrap_or(iced_native::event::Status::Ignored) .unwrap_or(iced_native::event::Status::Ignored)
} }
fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
self.with_overlay_maybe(|overlay| {
overlay.is_over(layout, cursor_position)
})
.unwrap_or_default()
}
} }
impl<'a, Message, Renderer, Dependency, View> impl<'a, Message, Renderer, Dependency, View>

View file

@ -415,4 +415,11 @@ where
}) })
.unwrap_or(iced_native::event::Status::Ignored) .unwrap_or(iced_native::event::Status::Ignored)
} }
fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
self.with_overlay_maybe(|overlay| {
overlay.is_over(layout, cursor_position)
})
.unwrap_or_default()
}
} }