summaryrefslogtreecommitdiffstats
path: root/lazy
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-02-14 06:32:05 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-14 06:32:05 +0100
commit2c680a3e5fe8cc3d6cceafe670d71290828018fc (patch)
tree260ce64ad99bdfb931e6611b4282822f6516ec22 /lazy
parent92ba26b8a168b1d58b8330d84753c5ab7e116f17 (diff)
parent8fe851057df0df113aaac6b8dc067b3a75d18d65 (diff)
downloadiced-2c680a3e5fe8cc3d6cceafe670d71290828018fc.tar.gz
iced-2c680a3e5fe8cc3d6cceafe670d71290828018fc.tar.bz2
iced-2c680a3e5fe8cc3d6cceafe670d71290828018fc.zip
Merge pull request #1699 from nicksenger/overlay/is_over
Implement `is_over` for iced_lazy widget `Overlay`s
Diffstat (limited to '')
-rw-r--r--lazy/src/component.rs7
-rw-r--r--lazy/src/lazy.rs7
-rw-r--r--lazy/src/responsive.rs7
3 files changed, 21 insertions, 0 deletions
diff --git a/lazy/src/component.rs b/lazy/src/component.rs
index 94263274..4c03e2a3 100644
--- a/lazy/src/component.rs
+++ b/lazy/src/component.rs
@@ -563,4 +563,11 @@ where
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()
+ }
}
diff --git a/lazy/src/lazy.rs b/lazy/src/lazy.rs
index 9795afa4..5e909a49 100644
--- a/lazy/src/lazy.rs
+++ b/lazy/src/lazy.rs
@@ -372,6 +372,13 @@ where
})
.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>
diff --git a/lazy/src/responsive.rs b/lazy/src/responsive.rs
index e399e7b0..93069493 100644
--- a/lazy/src/responsive.rs
+++ b/lazy/src/responsive.rs
@@ -415,4 +415,11 @@ where
})
.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()
+ }
}