Implement Overlay::mouse_interaction for overlay::Menu
This commit is contained in:
parent
9c7e340b28
commit
1ec667920a
1 changed files with 25 additions and 0 deletions
|
|
@ -233,6 +233,16 @@ where
|
|||
)
|
||||
}
|
||||
|
||||
fn mouse_interaction(
|
||||
&self,
|
||||
layout: Layout<'_>,
|
||||
viewport: &Rectangle,
|
||||
cursor_position: Point,
|
||||
) -> mouse::Interaction {
|
||||
self.container
|
||||
.mouse_interaction(layout, viewport, cursor_position)
|
||||
}
|
||||
|
||||
fn draw(
|
||||
&self,
|
||||
renderer: &mut Renderer,
|
||||
|
|
@ -374,6 +384,21 @@ where
|
|||
event::Status::Ignored
|
||||
}
|
||||
|
||||
fn mouse_interaction(
|
||||
&self,
|
||||
layout: Layout<'_>,
|
||||
_viewport: &Rectangle,
|
||||
cursor_position: Point,
|
||||
) -> mouse::Interaction {
|
||||
let is_mouse_over = layout.bounds().contains(cursor_position);
|
||||
|
||||
if is_mouse_over {
|
||||
mouse::Interaction::Pointer
|
||||
} else {
|
||||
mouse::Interaction::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn draw(
|
||||
&self,
|
||||
renderer: &mut Renderer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue