summaryrefslogtreecommitdiffstats
path: root/web/src/widget/button.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-11-26 02:52:34 +0100
committerLibravatar GitHub <noreply@github.com>2020-11-26 02:52:34 +0100
commit1f7e8b7f3d1804c39c8e0934b25f3ef178de269c (patch)
tree380d9224b81537e460ea7f9fe84c0c912d3f4cbf /web/src/widget/button.rs
parentbffaeed9fd44619491c012cd9270043828c1849c (diff)
parent01322f69a406eee76014f5e2834336e2295ad80e (diff)
downloadiced-1f7e8b7f3d1804c39c8e0934b25f3ef178de269c.tar.gz
iced-1f7e8b7f3d1804c39c8e0934b25f3ef178de269c.tar.bz2
iced-1f7e8b7f3d1804c39c8e0934b25f3ef178de269c.zip
Merge pull request #632 from hecrj/improvement/update-docs
Use intra-doc links
Diffstat (limited to 'web/src/widget/button.rs')
-rw-r--r--web/src/widget/button.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/web/src/widget/button.rs b/web/src/widget/button.rs
index a4bcc33d..e7cff6a0 100644
--- a/web/src/widget/button.rs
+++ b/web/src/widget/button.rs
@@ -1,9 +1,6 @@
//! Allow your users to perform actions by pressing a button.
//!
//! A [`Button`] has some local [`State`].
-//!
-//! [`Button`]: struct.Button.html
-//! [`State`]: struct.State.html
use crate::{css, Background, Bus, Css, Element, Length, Widget};
pub use iced_style::button::{Style, StyleSheet};
@@ -38,9 +35,6 @@ pub struct Button<'a, Message> {
impl<'a, Message> Button<'a, Message> {
/// Creates a new [`Button`] with some local [`State`] and the given
/// content.
- ///
- /// [`Button`]: struct.Button.html
- /// [`State`]: struct.State.html
pub fn new<E>(_state: &'a mut State, content: E) -> Self
where
E: Into<Element<'a, Message>>,
@@ -58,56 +52,42 @@ impl<'a, Message> Button<'a, Message> {
}
/// Sets the width of the [`Button`].
- ///
- /// [`Button`]: struct.Button.html
pub fn width(mut self, width: Length) -> Self {
self.width = width;
self
}
/// Sets the height of the [`Button`].
- ///
- /// [`Button`]: struct.Button.html
pub fn height(mut self, height: Length) -> Self {
self.height = height;
self
}
/// Sets the minimum width of the [`Button`].
- ///
- /// [`Button`]: struct.Button.html
pub fn min_width(mut self, min_width: u32) -> Self {
self.min_width = min_width;
self
}
/// Sets the minimum height of the [`Button`].
- ///
- /// [`Button`]: struct.Button.html
pub fn min_height(mut self, min_height: u32) -> Self {
self.min_height = min_height;
self
}
/// Sets the padding of the [`Button`].
- ///
- /// [`Button`]: struct.Button.html
pub fn padding(mut self, padding: u16) -> Self {
self.padding = padding;
self
}
/// Sets the style of the [`Button`].
- ///
- /// [`Button`]: struct.Button.html
pub fn style(mut self, style: impl Into<Box<dyn StyleSheet>>) -> Self {
self.style = style.into();
self
}
/// Sets the message that will be produced when the [`Button`] is pressed.
- ///
- /// [`Button`]: struct.Button.html
pub fn on_press(mut self, msg: Message) -> Self {
self.on_press = Some(msg);
self
@@ -115,15 +95,11 @@ impl<'a, Message> Button<'a, Message> {
}
/// The local state of a [`Button`].
-///
-/// [`Button`]: struct.Button.html
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct State;
impl State {
/// Creates a new [`State`].
- ///
- /// [`State`]: struct.State.html
pub fn new() -> State {
State::default()
}