Introduce mouse_interaction method to Widget trait
This commit is contained in:
parent
7a876c8b29
commit
be97a5d502
10 changed files with 152 additions and 21 deletions
|
|
@ -2,8 +2,9 @@ pub use crate::Overlay;
|
|||
|
||||
use crate::event::{self, Event};
|
||||
use crate::layout;
|
||||
use crate::mouse;
|
||||
use crate::renderer;
|
||||
use crate::{Clipboard, Hasher, Layout, Point, Size, Vector};
|
||||
use crate::{Clipboard, Hasher, Layout, Point, Rectangle, Size, Vector};
|
||||
|
||||
/// A generic [`Overlay`].
|
||||
#[allow(missing_debug_implementations)]
|
||||
|
|
@ -68,6 +69,16 @@ where
|
|||
)
|
||||
}
|
||||
|
||||
pub fn mouse_interaction(
|
||||
&self,
|
||||
layout: Layout<'_>,
|
||||
viewport: &Rectangle,
|
||||
cursor_position: Point,
|
||||
) -> mouse::Interaction {
|
||||
self.overlay
|
||||
.mouse_interaction(layout, viewport, cursor_position)
|
||||
}
|
||||
|
||||
/// Draws the [`Element`] and its children using the given [`Layout`].
|
||||
pub fn draw(
|
||||
&self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue