Remove hash_layout method from Widget trait

This commit is contained in:
Héctor Ramón Jiménez 2022-02-22 14:10:49 +07:00
parent 9fe5080153
commit 1313c94e3b
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
35 changed files with 105 additions and 636 deletions

View file

@ -10,7 +10,7 @@ use crate::event::{self, Event};
use crate::layout;
use crate::mouse;
use crate::renderer;
use crate::{Clipboard, Hasher, Layout, Point, Rectangle, Shell, Size};
use crate::{Clipboard, Layout, Point, Rectangle, Shell, Size};
/// An interactive component that can be displayed on top of other widgets.
pub trait Overlay<Message, Renderer>
@ -39,19 +39,6 @@ where
cursor_position: Point,
);
/// Computes the _layout_ hash of the [`Overlay`].
///
/// The produced hash is used by the runtime to decide if the [`Layout`]
/// needs to be recomputed between frames. Therefore, to ensure maximum
/// efficiency, the hash should only be affected by the properties of the
/// [`Overlay`] that can affect layouting.
///
/// For example, the [`Text`] widget does not hash its color property, as
/// its value cannot affect the overall [`Layout`] of the user interface.
///
/// [`Text`]: crate::widget::Text
fn hash_layout(&self, state: &mut Hasher, position: Point);
/// Processes a runtime [`Event`].
///
/// It receives: