diff options
Diffstat (limited to 'src/widget/button.rs')
-rw-r--r-- | src/widget/button.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/widget/button.rs b/src/widget/button.rs index 35fa6ca8..14fd3852 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -16,11 +16,10 @@ use std::hash::Hash; /// A generic widget that produces a message when clicked. /// -/// It implements [`Widget`] when the associated [`core::Renderer`] implements -/// the [`button::Renderer`] trait. +/// It implements [`Widget`] when the associated `Renderer` implements the +/// [`button::Renderer`] trait. /// -/// [`Widget`]: ../../core/trait.Widget.html -/// [`core::Renderer`]: ../../core/trait.Renderer.html +/// [`Widget`]: ../trait.Widget.html /// [`button::Renderer`]: trait.Renderer.html /// /// # Example @@ -37,6 +36,8 @@ use std::hash::Hash; /// Button::new(state, "Click me!") /// .on_press(Message::ButtonClicked); /// ``` +/// +///  pub struct Button<'a, Message> { state: &'a mut State, label: String, @@ -186,7 +187,7 @@ where ) } - fn hash(&self, state: &mut Hasher) { + fn hash_layout(&self, state: &mut Hasher) { self.style.hash(state); } } @@ -218,7 +219,7 @@ impl State { /// The type of a [`Button`]. /// -///  +///  /// /// [`Button`]: struct.Button.html #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -241,11 +242,11 @@ pub enum Class { /// The renderer of a [`Button`]. /// -/// Your [`core::Renderer`] will need to implement this trait before being +/// Your [renderer] will need to implement this trait before being /// able to use a [`Button`] in your user interface. /// /// [`Button`]: struct.Button.html -/// [`core::Renderer`]: ../../core/trait.Renderer.html +/// [renderer]: ../../renderer/index.html pub trait Renderer { /// Draws a [`Button`]. /// @@ -262,7 +263,7 @@ pub trait Renderer { fn draw( &mut self, cursor_position: Point, - bounds: Rectangle<f32>, + bounds: Rectangle, state: &State, label: &str, class: Class, |