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
|
|
@ -8,8 +8,9 @@ pub use menu::Menu;
|
|||
|
||||
use crate::event::{self, Event};
|
||||
use crate::layout;
|
||||
use crate::mouse;
|
||||
use crate::renderer;
|
||||
use crate::{Clipboard, Hasher, Layout, Point, Size};
|
||||
use crate::{Clipboard, Hasher, Layout, Point, Rectangle, Size};
|
||||
|
||||
/// An interactive component that can be displayed on top of other widgets.
|
||||
pub trait Overlay<Message, Renderer>
|
||||
|
|
@ -74,4 +75,16 @@ where
|
|||
) -> event::Status {
|
||||
event::Status::Ignored
|
||||
}
|
||||
|
||||
/// Returns the current [`mouse::Interaction`] of the [`Widget`].
|
||||
///
|
||||
/// By default, it returns [`mouse::Interaction::Idle`].
|
||||
fn mouse_interaction(
|
||||
&self,
|
||||
_layout: Layout<'_>,
|
||||
_viewport: &Rectangle,
|
||||
_cursor_position: Point,
|
||||
) -> mouse::Interaction {
|
||||
mouse::Interaction::Idle
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue