summaryrefslogtreecommitdiffstats
path: root/native/src/overlay.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/overlay.rs')
-rw-r--r--native/src/overlay.rs26
1 files changed, 9 insertions, 17 deletions
diff --git a/native/src/overlay.rs b/native/src/overlay.rs
index 7c3bec32..84145e7f 100644
--- a/native/src/overlay.rs
+++ b/native/src/overlay.rs
@@ -6,7 +6,9 @@ pub mod menu;
pub use element::Element;
pub use menu::Menu;
-use crate::{layout, Clipboard, Event, Hasher, Layout, Point, Size};
+use crate::event::{self, Event};
+use crate::layout;
+use crate::{Clipboard, Hasher, Layout, Point, Size};
/// An interactive component that can be displayed on top of other widgets.
pub trait Overlay<Message, Renderer>
@@ -18,9 +20,7 @@ where
/// This [`Node`] is used by the runtime to compute the [`Layout`] of the
/// user interface.
///
- /// [`Node`]: ../layout/struct.Node.html
- /// [`Widget`]: trait.Overlay.html
- /// [`Layout`]: ../layout/struct.Layout.html
+ /// [`Node`]: layout::Node
fn layout(
&self,
renderer: &Renderer,
@@ -29,8 +29,6 @@ where
) -> layout::Node;
/// Draws the [`Overlay`] using the associated `Renderer`.
- ///
- /// [`Overlay`]: trait.Overlay.html
fn draw(
&self,
renderer: &mut Renderer,
@@ -49,9 +47,7 @@ where
/// For example, the [`Text`] widget does not hash its color property, as
/// its value cannot affect the overall [`Layout`] of the user interface.
///
- /// [`Overlay`]: trait.Overlay.html
- /// [`Layout`]: ../layout/struct.Layout.html
- /// [`Text`]: text/struct.Text.html
+ /// [`Text`]: crate::widget::Text
fn hash_layout(&self, state: &mut Hasher, position: Point);
/// Processes a runtime [`Event`].
@@ -66,19 +62,15 @@ where
/// * a [`Clipboard`], if available
///
/// By default, it does nothing.
- ///
- /// [`Event`]: ../enum.Event.html
- /// [`Overlay`]: trait.Widget.html
- /// [`Layout`]: ../layout/struct.Layout.html
- /// [`Clipboard`]: ../trait.Clipboard.html
fn on_event(
&mut self,
_event: Event,
_layout: Layout<'_>,
_cursor_position: Point,
- _messages: &mut Vec<Message>,
_renderer: &Renderer,
- _clipboard: Option<&dyn Clipboard>,
- ) {
+ _clipboard: &mut dyn Clipboard,
+ _messages: &mut Vec<Message>,
+ ) -> event::Status {
+ event::Status::Ignored
}
}