summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-24 01:59:34 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-01-24 01:59:34 +0100
commit01c484245be54c1aeb6605659fb0f222856c28da (patch)
treee9b101cb188d03b6473324e293efb75a3434f4bf
parentbe860508a9deed1f4583e045790eb9ddd74d07d5 (diff)
downloadiced-01c484245be54c1aeb6605659fb0f222856c28da.tar.gz
iced-01c484245be54c1aeb6605659fb0f222856c28da.tar.bz2
iced-01c484245be54c1aeb6605659fb0f222856c28da.zip
Fix some minor documentation inconsistencies
-rw-r--r--native/src/overlay.rs5
-rw-r--r--native/src/overlay/element.rs2
-rw-r--r--native/src/overlay/group.rs6
3 files changed, 8 insertions, 5 deletions
diff --git a/native/src/overlay.rs b/native/src/overlay.rs
index 1c3d0fb9..6cada416 100644
--- a/native/src/overlay.rs
+++ b/native/src/overlay.rs
@@ -90,7 +90,10 @@ where
mouse::Interaction::Idle
}
- /// Returns true if the cursor is over the [`Overlay`]
+ /// Returns true if the cursor is over the [`Overlay`].
+ ///
+ /// By default, it returns true if the bounds of the `layout` contain
+ /// the `cursor_position`.
fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
layout.bounds().contains(cursor_position)
}
diff --git a/native/src/overlay/element.rs b/native/src/overlay/element.rs
index edeb7dbf..bdf7766e 100644
--- a/native/src/overlay/element.rs
+++ b/native/src/overlay/element.rs
@@ -116,7 +116,7 @@ where
self.overlay.operate(layout, renderer, operation);
}
- /// Returns true if the cursor is over the [`Element`]
+ /// Returns true if the cursor is over the [`Element`].
pub fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
self.overlay.is_over(layout, cursor_position)
}
diff --git a/native/src/overlay/group.rs b/native/src/overlay/group.rs
index fa3c7396..5c9cf809 100644
--- a/native/src/overlay/group.rs
+++ b/native/src/overlay/group.rs
@@ -8,8 +8,8 @@ use crate::renderer;
use crate::widget;
use crate::{Clipboard, Event, Layout, Overlay, Shell};
-/// An [`Overlay`] container that displays multiple overlay
-/// [`overlay::Element`] children
+/// An [`Overlay`] container that displays multiple overlay [`overlay::Element`]
+/// children.
#[allow(missing_debug_implementations)]
pub struct Group<'a, Message, Renderer> {
children: Vec<overlay::Element<'a, Message, Renderer>>,
@@ -41,7 +41,7 @@ where
self
}
- /// Turns the [`Group`] into an overlay [`overlay::Element`]
+ /// Turns the [`Group`] into an overlay [`overlay::Element`].
pub fn overlay(self) -> overlay::Element<'a, Message, Renderer> {
overlay::Element::new(Point::ORIGIN, Box::new(self))
}