summaryrefslogtreecommitdiffstats
path: root/native/src/widget.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-18 16:43:18 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-18 16:43:18 +0700
commitbe97a5d502df8c8b23704f5a8a0d425f4eff2215 (patch)
tree187f0477534c5d5c783ef06686e2209bbf4f3b80 /native/src/widget.rs
parent7a876c8b2918ae90cedfd82d1881cf6406811eeb (diff)
downloadiced-be97a5d502df8c8b23704f5a8a0d425f4eff2215.tar.gz
iced-be97a5d502df8c8b23704f5a8a0d425f4eff2215.tar.bz2
iced-be97a5d502df8c8b23704f5a8a0d425f4eff2215.zip
Introduce `mouse_interaction` method to `Widget` trait
Diffstat (limited to '')
-rw-r--r--native/src/widget.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/native/src/widget.rs b/native/src/widget.rs
index 9a494771..9999701e 100644
--- a/native/src/widget.rs
+++ b/native/src/widget.rs
@@ -80,6 +80,7 @@ pub use tooltip::Tooltip;
use crate::event::{self, Event};
use crate::layout;
+use crate::mouse;
use crate::overlay;
use crate::renderer;
use crate::{Clipboard, Hasher, Layout, Length, Point, Rectangle};
@@ -175,6 +176,18 @@ where
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
+ }
+
/// Returns the overlay of the [`Widget`], if there is any.
fn overlay(
&mut self,