Merge branch 'master' into virtual-widgets

This commit is contained in:
Héctor Ramón Jiménez 2022-03-07 15:29:43 +07:00
commit c35496d80f
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
58 changed files with 446 additions and 909 deletions

View file

@ -7,11 +7,10 @@ use crate::mouse;
use crate::renderer;
use crate::touch;
use crate::{
Background, Clipboard, Color, Element, Hasher, Layout, Length, Point,
Rectangle, Shell, Size, Widget,
Background, Clipboard, Color, Element, Layout, Length, Point, Rectangle,
Shell, Size, Widget,
};
use std::hash::Hash;
use std::ops::RangeInclusive;
pub use iced_style::slider::{Handle, HandleShape, Style, StyleSheet};
@ -344,14 +343,6 @@ pub fn mouse_interaction(
}
}
/// Hashes the layout of a [`Slider`].
pub fn hash_layout(state: &mut Hasher, width: Length) {
struct Marker;
std::any::TypeId::of::<Marker>().hash(state);
width.hash(state);
}
/// The local state of a [`Slider`].
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct State {
@ -444,10 +435,6 @@ where
) -> mouse::Interaction {
mouse_interaction(layout, cursor_position, &self.state)
}
fn hash_layout(&self, state: &mut Hasher) {
hash_layout(state, self.width)
}
}
impl<'a, T, Message, Renderer> From<Slider<'a, T, Message>>