diff --git a/src/core/color.rs b/src/core/color.rs index ab9a35e3..658dac93 100644 --- a/src/core/color.rs +++ b/src/core/color.rs @@ -14,7 +14,7 @@ pub struct Hsv { } impl Hsv { - /// Creates a [`Hsv`](Hsv) from its HSV components. + /// Creates a [`Hsv`] from its HSV components. #[must_use] pub const fn from_hsv(hue: u16, saturation: f32, value: f32) -> Self { Self { diff --git a/src/native/badge.rs b/src/native/badge.rs index 9fe0a9bd..3a6038a1 100644 --- a/src/native/badge.rs +++ b/src/native/badge.rs @@ -40,13 +40,13 @@ where width: Length, /// The height of the [`Badge`]. height: Length, - /// The horizontal alignment of the [`Badge`](Badge). + /// The horizontal alignment of the [`Badge`]. horizontal_alignment: Alignment, - /// The vertical alignment of the [`Badge`](Badge). + /// The vertical alignment of the [`Badge`]. vertical_alignment: Alignment, - /// The style of the [`Badge`](Badge). + /// The style of the [`Badge`]. style: ::Style, - /// The content [`Element`] of the [`Badge`](Badge). + /// The content [`Element`] of the [`Badge`]. content: Element<'a, Message, Renderer>, } @@ -55,10 +55,10 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// Creates a new [`Badge`](Badge) with the given content. + /// Creates a new [`Badge`] with the given content. /// /// It expects: - /// * the content [`Element`] to display in the [`Badge`](Badge). + /// * the content [`Element`] to display in the [`Badge`]. pub fn new(content: T) -> Self where T: Into>, @@ -74,42 +74,42 @@ where } } - /// Sets the padding of the [`Badge`](Badge). + /// Sets the padding of the [`Badge`]. #[must_use] pub fn padding(mut self, units: u16) -> Self { self.padding = units; self } - /// Sets the width of the [`Badge`](Badge). + /// Sets the width of the [`Badge`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`Badge`](Badge). + /// Sets the height of the [`Badge`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the horizontal alignment of the content of the [`Badge`](Badge). + /// Sets the horizontal alignment of the content of the [`Badge`]. #[must_use] pub fn align_x(mut self, alignment: Alignment) -> Self { self.horizontal_alignment = alignment; self } - /// Sets the vertical alignment of the content of the [`Badge`](Badge). + /// Sets the vertical alignment of the content of the [`Badge`]. #[must_use] pub fn align_y(mut self, alignment: Alignment) -> Self { self.vertical_alignment = alignment; self } - /// Sets the style of the [`Badge`](Badge). + /// Sets the style of the [`Badge`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; diff --git a/src/native/card.rs b/src/native/card.rs index db803fa7..a3cfc5da 100644 --- a/src/native/card.rs +++ b/src/native/card.rs @@ -1,4 +1,4 @@ -//! Displays a [`Card`](Card). +//! Displays a [`Card`]. //! //! *This API requires the following crate features to be activated: card* @@ -20,7 +20,7 @@ use iced_widget::{ use crate::graphics::icons::{Icon, ICON_FONT}; pub use crate::style::card::{Appearance, StyleSheet}; -/// The default padding of a [`Card`](Card). +/// The default padding of a [`Card`]. const DEFAULT_PADDING: f32 = 10.0; /// A card consisting of a head, body and optional foot. @@ -49,31 +49,31 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// The width of the [`Card`](Card). + /// The width of the [`Card`]. width: Length, - /// The height of the [`Card`](Card). + /// The height of the [`Card`]. height: Length, - /// The maximum width of the [`Card`](Card). + /// The maximum width of the [`Card`]. max_width: f32, - /// The maximum height of the [`Card`](Card). + /// The maximum height of the [`Card`]. max_height: f32, - /// The padding of the head of the [`Card`](Card). + /// The padding of the head of the [`Card`]. padding_head: f32, - /// The padding of the body of the [`Card`](Card). + /// The padding of the body of the [`Card`]. padding_body: f32, - /// The padding of the foot of the [`Card`](Card). + /// The padding of the foot of the [`Card`]. padding_foot: f32, - /// The optional size of the close icon of the [`Card`](Card). + /// The optional size of the close icon of the [`Card`]. close_size: Option, - /// The optional message that is send if the close icon of the [`Card`](Card) is pressed. + /// The optional message that is send if the close icon of the [`Card`] is pressed. on_close: Option, - /// The head [`Element`] of the [`Card`](Card). + /// The head [`Element`] of the [`Card`]. head: Element<'a, Message, Renderer>, - /// The body [`Element`] of the [`Card`](Card). + /// The body [`Element`] of the [`Card`]. body: Element<'a, Message, Renderer>, - /// The optional foot [`Element`] of the [`Card`](Card). + /// The optional foot [`Element`] of the [`Card`]. foot: Option>, - /// The style of the [`Card`](Card). + /// The style of the [`Card`]. style: ::Style, } @@ -82,13 +82,11 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// Creates a new [`Card`](Card) containing the given head and body. + /// Creates a new [`Card`] containing the given head and body. /// /// It expects: - /// * the head [`Element`] to display at the top of - /// the [`Card`](Card). - /// * the body [`Element`] to display at the middle - /// of the [`Card`](Card). + /// * the head [`Element`] to display at the top of the [`Card`]. + /// * the body [`Element`] to display at the middle of the [`Card`]. pub fn new(head: H, body: B) -> Self where H: Into>, @@ -111,7 +109,7 @@ where } } - /// Sets the [`Element`] of the foot of the [`Card`](Card). + /// Sets the [`Element`] of the foot of the [`Card`]. #[must_use] pub fn foot(mut self, foot: F) -> Self where @@ -121,35 +119,35 @@ where self } - /// Sets the width of the [`Card`](Card). + /// Sets the width of the [`Card`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`Card`](Card). + /// Sets the height of the [`Card`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the maximum width of the [`Card`](Card). + /// Sets the maximum width of the [`Card`]. #[must_use] pub fn max_width(mut self, width: f32) -> Self { self.max_width = width; self } - /// Sets the maximum height of the [`Card`](Card). + /// Sets the maximum height of the [`Card`]. #[must_use] pub fn max_height(mut self, height: f32) -> Self { self.max_height = height; self } - /// Sets the padding of the [`Card`](Card). + /// Sets the padding of the [`Card`]. /// /// This will set the padding of the head, body and foot to the /// same value. @@ -161,28 +159,28 @@ where self } - /// Sets the padding of the head of the [`Card`](Card). + /// Sets the padding of the head of the [`Card`]. #[must_use] pub fn padding_head(mut self, padding: f32) -> Self { self.padding_head = padding; self } - /// Sets the padding of the body of the [`Card`](Card). + /// Sets the padding of the body of the [`Card`]. #[must_use] pub fn padding_body(mut self, padding: f32) -> Self { self.padding_body = padding; self } - /// Sets the padding of the foot of the [`Card`](Card). + /// Sets the padding of the foot of the [`Card`]. #[must_use] pub fn padding_foot(mut self, padding: f32) -> Self { self.padding_foot = padding; self } - /// Sets the size of the close icon of the [`Card`](Card). + /// Sets the size of the close icon of the [`Card`]. #[must_use] pub fn close_size(mut self, size: f32) -> Self { self.close_size = Some(size); @@ -190,16 +188,16 @@ where } /// Sets the message that will be produced when the close icon of the - /// [`Card`](Card) is pressed. + /// [`Card`] is pressed. /// - /// Setting this enables the drawing of a close icon on the [`Card`](Card). + /// Setting this enables the drawing of a close icon on the [`Card`]. #[must_use] pub fn on_close(mut self, msg: Message) -> Self { self.on_close = Some(msg); self } - /// Sets the style of the [`Card`](Card). + /// Sets the style of the [`Card`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; diff --git a/src/native/color_picker.rs b/src/native/color_picker.rs index fdc66a5d..eb14019b 100644 --- a/src/native/color_picker.rs +++ b/src/native/color_picker.rs @@ -60,11 +60,11 @@ where color: Color, /// The underlying element. underlay: Element<'a, Message, Renderer>, - /// The message that is send if the cancel button of the [`ColorPickerOverlay`](ColorPickerOverlay) is pressed. + /// The message that is sent if the cancel button of the [`ColorPickerOverlay`] is pressed. on_cancel: Message, - /// The function that produces a message when the submit button of the [`ColorPickerOverlay`](ColorPickerOverlay) is pressed. + /// The function that produces a message when the submit button of the [`ColorPickerOverlay`] is pressed. on_submit: Box Message>, - /// The style of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The style of the [`ColorPickerOverlay`]. style: ::Style, /// The buttons of the overlay. overlay_state: Element<'a, Message, Renderer>, @@ -75,16 +75,16 @@ where Message: 'a + Clone, Theme: 'a + StyleSheet + button::StyleSheet + widget::text::StyleSheet, { - /// Creates a new [`ColorPicker`](ColorPicker) wrapping around the given underlay. + /// Creates a new [`ColorPicker`] wrapping around the given underlay. /// /// It expects: /// * if the overlay of the color picker is visible. /// * the initial color to show. - /// * the underlay [`Element`] on which this [`ColorPicker`](ColorPicker) + /// * the underlay [`Element`] on which this [`ColorPicker`] /// will be wrapped around. - /// * a message that will be send when the cancel button of the [`ColorPicker`](ColorPicker) + /// * a message that will be send when the cancel button of the [`ColorPicker`] /// is pressed. - /// * a function that will be called when the submit button of the [`ColorPicker`](ColorPicker) + /// * a function that will be called when the submit button of the [`ColorPicker`] /// is pressed, which takes the picked [`Color`] value. pub fn new( show_picker: bool, @@ -108,7 +108,7 @@ where } } - /// Sets the style of the [`ColorPicker`](ColorPicker). + /// Sets the style of the [`ColorPicker`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; @@ -116,7 +116,7 @@ where } } -/// The state of the [`ColorPicker`](ColorPicker). +/// The state of the [`ColorPicker`]. #[derive(Debug, Default)] pub struct State { /// The state of the overlay. @@ -124,7 +124,7 @@ pub struct State { } impl State { - /// Creates a new [`State`](State). + /// Creates a new [`State`]. #[must_use] pub fn new(color: Color) -> Self { Self { diff --git a/src/native/context_menu.rs b/src/native/context_menu.rs index 793ebf7d..7b60d001 100644 --- a/src/native/context_menu.rs +++ b/src/native/context_menu.rs @@ -42,9 +42,9 @@ where { /// The underlying element. underlay: Element<'a, Message, Renderer>, - /// The content of [`ContextMenuOverlay`](ContextMenuOverlay). + /// The content of [`ContextMenuOverlay`]. overlay: Overlay, - /// The style of the [`ContextMenu`](ContextMenu). + /// The style of the [`ContextMenu`]. style: ::Style, } @@ -55,11 +55,11 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// Creates a new [`ContextMenu`](ContextMenu) + /// Creates a new [`ContextMenu`] /// /// `underlay`: The underlying element. /// - /// `overlay`: The content of [`ContextMenuOverlay`](ContextMenuOverlay) which will be displayed when `underlay` is clicked. + /// `overlay`: The content of [`ContextMenuOverlay`] which will be displayed when `underlay` is clicked. pub fn new(underlay: U, overlay: Overlay) -> Self where U: Into>, @@ -71,7 +71,7 @@ where } } - /// Sets the style of the [`ContextMenu`](ContextMenu). + /// Sets the style of the [`ContextMenu`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; @@ -252,14 +252,14 @@ where /// The state of the ``context_menu``. #[derive(Debug, Default)] pub(crate) struct State { - /// The visibility of the [`ContextMenu`](ContextMenu) overlay. + /// The visibility of the [`ContextMenu`] overlay. pub show: bool, /// Use for showing the overlay where the click was made. pub cursor_position: Point, } impl State { - /// Creates a new [`State`](State) containing the given state data. + /// Creates a new [`State`] containing the given state data. pub const fn new() -> Self { Self { show: false, diff --git a/src/native/cupertino/cupertino_alert.rs b/src/native/cupertino/cupertino_alert.rs index b66822a6..a2d80408 100644 --- a/src/native/cupertino/cupertino_alert.rs +++ b/src/native/cupertino/cupertino_alert.rs @@ -82,21 +82,21 @@ where Self::default() } - /// Sets the `child` for the [`CupertinoDialogAction`](CupertinoDialogAction). + /// Sets the `child` for the [`CupertinoDialogAction`]. #[must_use] pub fn child(mut self, child: Element<'a, Message, Renderer>) -> Self { self.child = child; self } - /// Sets `is_enabled` for the [`CupertinoDialogAction`](CupertinoDialogAction). + /// Sets `is_enabled` for the [`CupertinoDialogAction`]. #[must_use] pub fn is_enabled(mut self, is_enabled: bool) -> Self { self.is_enabled = is_enabled; self } - /// Sets `on_pressed` for the [`CupertinoDialogAction`](CupertinoDialogAction). + /// Sets `on_pressed` for the [`CupertinoDialogAction`]. #[must_use] pub fn on_pressed(mut self, on_pressed: Option) -> Self { self.on_pressed = on_pressed; @@ -182,56 +182,56 @@ where Self::default() } - /// Sets the `width` of the [`CupertinoAlert`](CupertinoAlert). + /// Sets the `width` of the [`CupertinoAlert`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the `height` of the [`CupertinoAlert`](CupertinoAlert). + /// Sets the `height` of the [`CupertinoAlert`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets `is_hidden` for the [`CupertinoAlert`](CupertinoAlert). + /// Sets `is_hidden` for the [`CupertinoAlert`]. #[must_use] pub fn is_hidden(mut self, is_hidden: bool) -> Self { self.is_hidden = is_hidden; self } - /// Sets the `title` of the [`CupertinoAlert`](CupertinoAlert). + /// Sets the `title` of the [`CupertinoAlert`]. #[must_use] pub fn title(mut self, title: String) -> Self { self.title = title; self } - /// Sets the `content` of the [`CupertinoAlert`](CupertinoAlert). + /// Sets the `content` of the [`CupertinoAlert`]. #[must_use] pub fn content(mut self, content: String) -> Self { self.content = content; self } - /// Sets the `actions` of the [`CupertinoAlert`](CupertinoAlert). + /// Sets the `actions` of the [`CupertinoAlert`]. #[must_use] pub fn actions(mut self, actions: Vec>) -> Self { self.actions = actions; self } - /// Sets the `backdrop` of the [`CupertinoAlert`](CupertinoAlert). + /// Sets the `backdrop` of the [`CupertinoAlert`]. #[must_use] pub fn backdrop(mut self, backdrop: Option) -> Self { self.backdrop = backdrop; self } - /// Sets `on_escape` for the [`CupertinoAlert`](CupertinoAlert). + /// Sets `on_escape` for the [`CupertinoAlert`]. #[must_use] pub fn on_escape(mut self, on_escape: Option) -> Self { self.on_escape = on_escape; diff --git a/src/native/cupertino/cupertino_button.rs b/src/native/cupertino/cupertino_button.rs index d1a49c73..ec60a345 100644 --- a/src/native/cupertino/cupertino_button.rs +++ b/src/native/cupertino/cupertino_button.rs @@ -78,21 +78,21 @@ where Self::default() } - /// Sets the `on_pressed` callback of the [`CupertinoButton`](CupertinoButton). + /// Sets the `on_pressed` callback of the [`CupertinoButton`]. #[must_use] pub fn on_pressed(mut self, on_pressed: Option) -> Self { self.on_pressed = on_pressed; self } - /// Sets the `is_filled` of the [`CupertinoButton`](CupertinoButton). + /// Sets the `is_filled` of the [`CupertinoButton`]. #[must_use] pub fn is_filled(mut self, is_filled: bool) -> Self { self.is_filled = is_filled; self } - /// Sets the `body` of the [`CupertinoButton`](CupertinoButton). + /// Sets the `body` of the [`CupertinoButton`]. #[must_use] pub fn body(mut self, body: T) -> Self where @@ -105,7 +105,7 @@ where self } - /// Sets the `colour` of the [`CupertinoButton`](CupertinoButton). + /// Sets the `colour` of the [`CupertinoButton`]. #[must_use] pub fn colour(mut self, colour: Option) -> Self { self.colour = colour; diff --git a/src/native/cupertino/cupertino_spinner.rs b/src/native/cupertino/cupertino_spinner.rs index d093484c..9fb71976 100644 --- a/src/native/cupertino/cupertino_spinner.rs +++ b/src/native/cupertino/cupertino_spinner.rs @@ -67,21 +67,21 @@ impl CupertinoSpinner { Self::default() } - /// Sets the width of the [`CupertinoSpinner`](CupertinoSpinner). + /// Sets the width of the [`CupertinoSpinner`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`CupertinoSpinner`](CupertinoSpinner). + /// Sets the height of the [`CupertinoSpinner`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the radius of the [`CupertinoSpinner`](CupertinoSpinner). + /// Sets the radius of the [`CupertinoSpinner`]. /// NOTE: While you _can_ tweak the radius, the scale may be all out of whack if not using a /// number close to the default of `20.0`. #[must_use] diff --git a/src/native/cupertino/cupertino_switch.rs b/src/native/cupertino/cupertino_switch.rs index c72b13e1..7342936a 100644 --- a/src/native/cupertino/cupertino_switch.rs +++ b/src/native/cupertino/cupertino_switch.rs @@ -100,63 +100,63 @@ where Self::default() } - /// Sets the width of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets the width of the [`CupertinoSwitch`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets the height of the [`CupertinoSwitch`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the active colour of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets the active colour of the [`CupertinoSwitch`]. #[must_use] pub fn active_colour(mut self, colour: Color) -> Self { self.active_colour = colour; self } - /// Sets the focus colour of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets the focus colour of the [`CupertinoSwitch`]. #[must_use] pub fn focus_colour(mut self, colour: Color) -> Self { self.focus_colour = colour; self } - /// Sets the thumb colour of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets the thumb colour of the [`CupertinoSwitch`]. #[must_use] pub fn thumb_colour(mut self, colour: Color) -> Self { self.thumb_colour = colour; self } - /// Sets `apply_theme` of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets `apply_theme` of the [`CupertinoSwitch`]. #[must_use] pub fn apply_theme(mut self, theme: bool) -> Self { self.apply_theme = theme; self } - // /// Sets `drag_start_behaviour` of the [`CupertinoSwitch`](CupertinoSwitch). + // /// Sets `drag_start_behaviour` of the [`CupertinoSwitch`]. // #[must_use] // pub fn drag_start_behaviour(mut self, behaviour: bool) -> Self { // self.drag_start_behaviour = behaviour; // self // } - /// Sets `on_changed` of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets `on_changed` of the [`CupertinoSwitch`]. #[must_use] pub fn on_changed(mut self, on_changed: Option Message>>) -> Self { self.on_changed = on_changed; self } - /// Sets the value of the [`CupertinoSwitch`](CupertinoSwitch). + /// Sets the value of the [`CupertinoSwitch`]. #[must_use] pub fn value(mut self, value: bool) -> Self { self.value = value; diff --git a/src/native/date_picker.rs b/src/native/date_picker.rs index 556a8c16..cb00210a 100644 --- a/src/native/date_picker.rs +++ b/src/native/date_picker.rs @@ -62,11 +62,11 @@ where date: Date, /// The underlying element. underlay: Element<'a, Message, Renderer>, - /// The message that is send if the cancel button of the [`DatePickerOverlay`](DatePickerOverlay) is pressed. + /// The message that is send if the cancel button of the [`DatePickerOverlay`] is pressed. on_cancel: Message, - /// The function that produces a message when the submit button of the [`DatePickerOverlay`](DatePickerOverlay) is pressed. + /// The function that produces a message when the submit button of the [`DatePickerOverlay`] is pressed. on_submit: Box Message>, - /// The style of the [`DatePickerOverlay`](DatePickerOverlay). + /// The style of the [`DatePickerOverlay`]. style: ::Style, /// The buttons of the overlay. overlay_state: Element<'a, Message, Renderer>, @@ -78,16 +78,16 @@ where Message: 'a + Clone, Theme: 'a + StyleSheet + button::StyleSheet + text::StyleSheet + container::StyleSheet, { - /// Creates a new [`DatePicker`](DatePicker) wrapping around the given underlay. + /// Creates a new [`DatePicker`] wrapping around the given underlay. /// /// It expects: /// * if the overlay of the date picker is visible. /// * the initial date to show. - /// * the underlay [`Element`] on which this [`DatePicker`](DatePicker) + /// * the underlay [`Element`] on which this [`DatePicker`] /// will be wrapped around. - /// * a message that will be send when the cancel button of the [`DatePicker`](DatePicker) + /// * a message that will be send when the cancel button of the [`DatePicker`] /// is pressed. - /// * a function that will be called when the submit button of the [`DatePicker`](DatePicker) + /// * a function that will be called when the submit button of the [`DatePicker`] /// is pressed, which takes the picked [`Date`](crate::date_picker::Date) value. pub fn new( show_picker: bool, @@ -112,7 +112,7 @@ where } } - /// Sets the style of the [`DatePicker`](DatePicker). + /// Sets the style of the [`DatePicker`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; @@ -121,7 +121,7 @@ where } } -/// The state of the [`DatePicker`](DatePicker) / [`DatePickerOverlay`](DatePickerOverlay). +/// The state of the [`DatePicker`] / [`DatePickerOverlay`]. #[derive(Debug)] pub struct State { /// The state of the overlay. @@ -129,7 +129,7 @@ pub struct State { } impl State { - /// Creates a new [`State`](State) with the current date. + /// Creates a new [`State`] with the current date. #[must_use] pub fn now() -> Self { Self { @@ -137,7 +137,7 @@ impl State { } } - /// Creates a new [`State`](State) with the given date. + /// Creates a new [`State`] with the given date. #[must_use] pub fn new(date: Date) -> Self { Self { diff --git a/src/native/floating_element.rs b/src/native/floating_element.rs index cc066128..3854366a 100644 --- a/src/native/floating_element.rs +++ b/src/native/floating_element.rs @@ -52,7 +52,7 @@ where hidden: bool, /// The underlying element. underlay: Element<'a, Message, Renderer>, - /// The floating element of the [`FloatingElementOverlay`](FloatingElementOverlay). + /// The floating element of the [`FloatingElementOverlay`]. element: Element<'a, Message, Renderer>, } @@ -60,11 +60,11 @@ impl<'a, Message, Renderer> FloatingElement<'a, Message, Renderer> where Renderer: core::Renderer, { - /// Creates a new [`FloatingElement`](FloatingElement) over some content, + /// Creates a new [`FloatingElement`] over some content, /// showing the given [`Element`]. /// /// It expects: - /// * the underlay [`Element`] on which this [`FloatingElement`](FloatingElement) + /// * the underlay [`Element`] on which this [`FloatingElement`] /// will be wrapped around. /// * a function that will lazily create the [`Element`] for the overlay. pub fn new(underlay: U, element: B) -> Self @@ -81,14 +81,14 @@ where } } - /// Sets the [`Anchor`](Anchor) of the [`FloatingElement`](FloatingElement). + /// Sets the [`Anchor`] of the [`FloatingElement`]. #[must_use] pub fn anchor(mut self, anchor: Anchor) -> Self { self.anchor = anchor; self } - /// Sets the [`Offset`](Offset) of the [`FloatingElement`](FloatingElement). + /// Sets the [`Offset`] of the [`FloatingElement`]. #[must_use] pub fn offset(mut self, offset: O) -> Self where @@ -98,7 +98,7 @@ where self } - /// Hide or unhide the [`Element`] on the [`FloatingElement`](FloatingElement). + /// Hide or unhide the [`Element`] on the [`FloatingElement`]. #[must_use] pub fn hide(mut self, hide: bool) -> Self { self.hidden = hide; diff --git a/src/native/floating_element/anchor.rs b/src/native/floating_element/anchor.rs index fd4700d5..4208e1f3 100644 --- a/src/native/floating_element/anchor.rs +++ b/src/native/floating_element/anchor.rs @@ -2,38 +2,38 @@ //! //! *This API requires the following crate features to be activated: `floating_element`* -/// Positional [`Anchor`](Anchor) for the [`FloatingElement`](super::FloatingElement). +/// Positional [`Anchor`] for the [`FloatingElement`](super::FloatingElement). #[derive(Copy, Clone, Debug, Hash)] pub enum Anchor { - /// NorthWest [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the top left of the underlying element. + /// NorthWest [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the top left of the underlying element. NorthWest, - /// NorthEast [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the top right of the underlying element. + /// NorthEast [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the top right of the underlying element. NorthEast, - /// SouthWest [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the bottom left of the underlying element. + /// SouthWest [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the bottom left of the underlying element. SouthWest, - /// SouthEast [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the bottom right of the underlying element. + /// SouthEast [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the bottom right of the underlying element. SouthEast, - /// North [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the top of the underlying element. + /// North [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the top of the underlying element. North, - /// East [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the right of the underlying element. + /// East [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the right of the underlying element. East, - /// South [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the bottom of the underlying element. + /// South [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the bottom of the underlying element. South, - /// West [`Anchor`](Anchor) for positioning the - /// [`Button`](iced_widget::Button) on the left of the underlying element. + /// West [`Anchor`] for positioning the [`Button`](iced_widget::Button) + /// on the left of the underlying element. West, } diff --git a/src/native/floating_element/offset.rs b/src/native/floating_element/offset.rs index 6a2128c3..7cd03449 100644 --- a/src/native/floating_element/offset.rs +++ b/src/native/floating_element/offset.rs @@ -4,7 +4,7 @@ use iced_widget::core::Point; -/// The [`Offset`](Offset) for the [`FloatingElement`](super::FloatingElement). +/// The [`Offset`] for the [`FloatingElement`](super::FloatingElement). #[derive(Copy, Clone, Debug)] pub struct Offset { /// Offset on the x-axis from the [`Anchor`](super::Anchor) diff --git a/src/native/grid.rs b/src/native/grid.rs index 4197aa0e..bea91878 100644 --- a/src/native/grid.rs +++ b/src/native/grid.rs @@ -31,13 +31,13 @@ use iced_widget::core::{ /// ``` #[allow(missing_debug_implementations)] pub struct Grid<'a, Message, Renderer = crate::Renderer> { - /// The distribution [`Strategy`](Strategy) of the [`Grid`](Grid). + /// The distribution [`Strategy`] of the [`Grid`]. strategy: Strategy, - /// The elements in the [`Grid`](Grid). + /// The elements in the [`Grid`]. elements: Vec>, } -/// The [`Strategy`](Strategy) of how to distribute the columns of the [`Grid`](Grid). +/// The [`Strategy`] of how to distribute the columns of the [`Grid`]. #[derive(Debug)] pub enum Strategy { /// Use `n` columns. @@ -56,14 +56,14 @@ impl<'a, Message, Renderer> Grid<'a, Message, Renderer> where Renderer: core::Renderer, { - /// Creates a [`Grid`](Grid) with ``Strategy::Columns(1)`` + /// Creates a [`Grid`] with ``Strategy::Columns(1)`` /// Use ``strategy()`` to update the Strategy. #[must_use] pub fn new() -> Self { Self::default() } - /// Creates a [`Grid`](Grid) with given elements and ``Strategy::Columns(1)`` + /// Creates a [`Grid`] with given elements and ``Strategy::Columns(1)`` /// Use ``strategy()`` to update the Strategy. #[must_use] pub fn with_children(children: Vec>) -> Self { @@ -73,7 +73,7 @@ where } } - /// Creates a new empty [`Grid`](Grid). + /// Creates a new empty [`Grid`]. /// Elements will be laid out in a specific amount of columns. #[must_use] pub fn with_columns(columns: usize) -> Self { @@ -83,7 +83,7 @@ where } } - /// Creates a new empty [`Grid`](Grid). + /// Creates a new empty [`Grid`]. /// Columns will be generated to fill the given space. #[must_use] pub fn with_column_width(column_width: f32) -> Self { @@ -93,7 +93,7 @@ where } } - /// Sets the [`Grid`](Grid) Strategy. + /// Sets the [`Grid`] Strategy. /// Default is ``Strategy::Columns(1)``. #[must_use] pub fn strategy(mut self, strategy: Strategy) -> Self { @@ -101,7 +101,7 @@ where self } - /// Adds an [`Element`](Element) to the [`Grid`](Grid). + /// Adds an [`Element`] to the [`Grid`]. #[must_use] pub fn push(mut self, element: E) -> Self where @@ -111,7 +111,7 @@ where self } - /// Inserts an [`Element`](Element) into the [`Grid`](Grid). + /// Inserts an [`Element`] into the [`Grid`]. pub fn insert(&mut self, element: E) where E: Into>, @@ -313,7 +313,7 @@ where } } -/// Builds the layout of the [`Grid`](grid). +/// Builds the layout of the [`Grid`]. fn build_grid( columns: usize, column_aligns: impl Iterator + Clone, diff --git a/src/native/mod.rs b/src/native/mod.rs index 32455200..b680ae1b 100644 --- a/src/native/mod.rs +++ b/src/native/mod.rs @@ -88,7 +88,7 @@ pub use tab_bar::TabLabel; #[cfg(feature = "tabs")] pub mod tabs; #[cfg(feature = "tabs")] -/// A [`Tabs`](Tabs) widget for showing a [`TabBar`](super::tab_bar::TabBar) +/// A [`Tabs`] widget for showing a [`TabBar`](super::tab_bar::TabBar) pub type Tabs<'a, Message, TabId, Renderer> = tabs::Tabs<'a, Message, TabId, Renderer>; #[cfg(feature = "tabs")] diff --git a/src/native/modal.rs b/src/native/modal.rs index 0a33d5ba..35cfd3b1 100644 --- a/src/native/modal.rs +++ b/src/native/modal.rs @@ -44,13 +44,13 @@ where { /// The underlying element. underlay: Element<'a, Message, Renderer>, - /// The optional content of the [`ModalOverlay`](ModalOverlay). + /// The optional content of the [`ModalOverlay`]. overlay: Option>, /// The optional message that will be send when the user clicked on the backdrop. backdrop: Option, /// The optional message that will be send when the ESC key was pressed. esc: Option, - /// The style of the [`ModalOverlay`](ModalOverlay). + /// The style of the [`ModalOverlay`]. style: ::Style, horizontal_alignment: alignment::Horizontal, vertical_alignment: alignment::Vertical, @@ -62,16 +62,14 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// Creates a new [`Modal`](Modal) wrapping the underlying element to - /// show some content as an overlay. + /// Creates a new [`Modal`] wrapping the underlying element to show some content as an overlay. /// - /// `state` is the content's state, assigned at the creation of the - /// overlying content. + /// If [`overlay`] is `Some`, the contained [`Element`] is shown over the underlying element. + /// If [`overlay`] is `None`, only the underlying element is shown. /// /// It expects: - /// * the underlay [`Element`] on which this [`Modal`](Modal) - /// will be wrapped around. - /// * the optional overlay [`Element`] of the [`Modal`](Modal). + /// * the underlay [`Element`] on which this [`Modal`] will be wrapped around. + /// * the optional overlay [`Element`] of the [`Modal`]. pub fn new( underlay: impl Into>, overlay: Option>>, @@ -88,7 +86,7 @@ where } /// Sets the message that will be produced when the backdrop of the - /// [`Modal`](Modal) is clicked. + /// [`Modal`] is clicked. #[must_use] pub fn backdrop(mut self, message: Message) -> Self { self.backdrop = Some(message); @@ -105,21 +103,21 @@ where self } - /// Sets the style of the [`Modal`](Modal). + /// Sets the style of the [`Modal`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; self } - /// Sets the content alignment for the horizontal axis of the [`Modal`](Modal). + /// Sets the content alignment for the horizontal axis of the [`Modal`]. #[must_use] pub fn align_x(mut self, alignment: alignment::Horizontal) -> Self { self.horizontal_alignment = alignment; self } - /// Sets the content alignment for the vertical axis of the [`Modal`](Modal). + /// Sets the content alignment for the vertical axis of the [`Modal`]. #[must_use] pub fn align_y(mut self, alignment: alignment::Vertical) -> Self { self.vertical_alignment = alignment; @@ -294,14 +292,14 @@ where /// The state of the modal. #[derive(Debug, Default)] pub struct State { - /// The visibility of the [`Modal`](Modal) overlay. + /// The visibility of the [`Modal`] overlay. show: bool, - /// The state of the content of the [`Modal`](Modal) overlay. + /// The state of the content of the [`Modal`] overlay. state: S, } impl State { - /// Creates a new [`State`](State) containing the given state data. + /// Creates a new [`State`] containing the given state data. pub const fn new(s: S) -> Self { Self { show: false, diff --git a/src/native/number_input.rs b/src/native/number_input.rs index 34c41b07..c76558d6 100644 --- a/src/native/number_input.rs +++ b/src/native/number_input.rs @@ -64,23 +64,23 @@ where + container::StyleSheet + text::StyleSheet, { - /// The current value of the [`NumberInput`](NumberInput). + /// The current value of the [`NumberInput`]. value: T, - /// The step for each modify of the [`NumberInput`](NumberInput). + /// The step for each modify of the [`NumberInput`]. step: T, - /// The min and max value of the [`NumberInput`](NumberInput). + /// The min and max value of the [`NumberInput`]. bounds: (T, T), - /// The content padding of the [`NumberInput`](NumberInput). + /// The content padding of the [`NumberInput`]. padding: f32, - /// The text size of the [`NumberInput`](NumberInput). + /// The text size of the [`NumberInput`]. size: Option, - /// The underlying element of the [`NumberInput`](NumberInput). + /// The underlying element of the [`NumberInput`]. content: TextInput<'a, Message, Renderer>, - /// The on_change event of the [`NumberInput`](NumberInput). + /// The on_change event of the [`NumberInput`]. on_change: Box Message>, - /// The style of the [`NumberInput`](NumberInput). + /// The style of the [`NumberInput`]. style: ::Style, - /// The font text of the [`NumberInput`](NumberInput). + /// The font text of the [`NumberInput`]. font: Renderer::Font, /// The Width to use for the NumberBox Default is Length::Fill width: Length, diff --git a/src/native/overlay/color_picker.rs b/src/native/overlay/color_picker.rs index ea59f51b..28562a33 100644 --- a/src/native/overlay/color_picker.rs +++ b/src/native/overlay/color_picker.rs @@ -56,17 +56,17 @@ where Message: Clone, Theme: StyleSheet + button::StyleSheet, { - /// The state of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The state of the [`ColorPickerOverlay`]. state: &'a mut State, - /// The cancel button of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The cancel button of the [`ColorPickerOverlay`]. cancel_button: Button<'a, Message, Renderer>, - /// The submit button of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The submit button of the [`ColorPickerOverlay`]. submit_button: Button<'a, Message, Renderer>, - /// The function that produces a message when the submit button of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The function that produces a message when the submit button of the [`ColorPickerOverlay`]. on_submit: &'a dyn Fn(Color) -> Message, - /// The position of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The position of the [`ColorPickerOverlay`]. position: Point, - /// The style of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The style of the [`ColorPickerOverlay`]. style: ::Style, /// The reference to the tree holding the state of this overlay. tree: &'a mut Tree, @@ -77,8 +77,7 @@ where Message: 'static + Clone, Theme: 'a + StyleSheet + button::StyleSheet + widget::text::StyleSheet, { - /// Creates a new [`ColorPickerOverlay`](ColorPickerOverlay) on the given - /// position. + /// Creates a new [`ColorPickerOverlay`] on the given position. pub fn new( state: &'a mut color_picker::State, on_cancel: Message, @@ -115,8 +114,7 @@ where } } - /// Turn this [`ColorPickerOverlay`](ColorPickerOverlay) into an overlay - /// [`Element`](overlay::Element). + /// Turn this [`ColorPickerOverlay`] into an overlay [`Element`](overlay::Element). #[must_use] pub fn overlay(self) -> overlay::Element<'a, Message, Renderer> { overlay::Element::new(self.position, Box::new(self)) @@ -1601,18 +1599,18 @@ fn hex_text( }); } -/// The state of the [`ColorPickerOverlay`](ColorPickerOverlay). +/// The state of the [`ColorPickerOverlay`]. #[derive(Debug)] pub struct State { - /// The selected color of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The selected color of the [`ColorPickerOverlay`]. pub(crate) color: Color, - /// The cache of the sat/value canvas of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The cache of the sat/value canvas of the [`ColorPickerOverlay`]. pub(crate) sat_value_canvas_cache: canvas::Cache, - /// The cache of the hue canvas of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The cache of the hue canvas of the [`ColorPickerOverlay`]. pub(crate) hue_canvas_cache: canvas::Cache, - /// The dragged color bar of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The dragged color bar of the [`ColorPickerOverlay`]. pub(crate) color_bar_dragged: ColorBarDragged, - /// the focus of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// the focus of the [`ColorPickerOverlay`]. pub(crate) focus: Focus, /// The previously pressed keyboard modifiers. pub(crate) keyboard_modifiers: keyboard::Modifiers, @@ -1649,9 +1647,9 @@ where Message: Clone, Theme: StyleSheet + button::StyleSheet, { - /// The cancel button of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The cancel button of the [`ColorPickerOverlay`]. cancel_button: Element<'a, Message, Renderer>, - /// The submit button of the [`ColorPickerOverlay`](ColorPickerOverlay). + /// The submit button of the [`ColorPickerOverlay`]. submit_button: Element<'a, Message, Renderer>, } @@ -1760,7 +1758,7 @@ impl Default for ColorBarDragged { } } -/// An enumeration of all focusable element of the [`ColorPickerOverlay`](ColorPickerOverlay). +/// An enumeration of all focusable element of the [`ColorPickerOverlay`]. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Focus { /// Nothing is in focus. diff --git a/src/native/overlay/context_menu.rs b/src/native/overlay/context_menu.rs index 67a6703a..70565388 100644 --- a/src/native/overlay/context_menu.rs +++ b/src/native/overlay/context_menu.rs @@ -23,13 +23,13 @@ where Renderer: 'a + core::Renderer, Renderer::Theme: StyleSheet, { - /// The state of the [`ContextMenuOverlay`](ContextMenuOverlay). + /// The state of the [`ContextMenuOverlay`]. tree: &'a mut Tree, - /// The content of the [`ContextMenuOverlay`](ContextMenuOverlay). + /// The content of the [`ContextMenuOverlay`]. content: Element<'a, Message, Renderer>, - /// The style of the [`ContextMenuOverlay`](ContextMenuOverlay). + /// The style of the [`ContextMenuOverlay`]. style: ::Style, - /// The state shared between [`ContextMenu`](crate::native::ContextMenu) and [`ContextMenuOverlay`](ContextMenuOverlay). + /// The state shared between [`ContextMenu`](crate::native::ContextMenu) and [`ContextMenuOverlay`]. state: &'a mut context_menu::State, } @@ -39,7 +39,7 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// Creates a new [`ContextMenuOverlay`](ContextMenuOverlay). + /// Creates a new [`ContextMenuOverlay`]. pub(crate) fn new( tree: &'a mut Tree, content: C, @@ -57,8 +57,7 @@ where } } - /// Turn this [`ContextMenuOverlay`] into an overlay - /// [`Element`](overlay::Element). + /// Turn this [`ContextMenuOverlay`] into an overlay [`Element`](overlay::Element). pub fn overlay(self, position: Point) -> overlay::Element<'a, Message, Renderer> { overlay::Element::new(position, Box::new(self)) } diff --git a/src/native/overlay/date_picker.rs b/src/native/overlay/date_picker.rs index 3e82d5aa..b90d7a11 100644 --- a/src/native/overlay/date_picker.rs +++ b/src/native/overlay/date_picker.rs @@ -51,17 +51,17 @@ where Message: Clone, Theme: StyleSheet + button::StyleSheet, { - /// The state of the [`DatePickerOverlay`](DatePickerOverlay). + /// The state of the [`DatePickerOverlay`]. state: &'a mut State, - /// The cancel button of the [`DatePickerOverlay`](DatePickerOverlay). + /// The cancel button of the [`DatePickerOverlay`]. cancel_button: Button<'a, Message, Renderer>, - /// The submit button of the [`DatePickerOverlay`](DatePickerOverlay). + /// The submit button of the [`DatePickerOverlay`]. submit_button: Button<'a, Message, Renderer>, - /// The function that produces a message when the submit button of the [`DatePickerOverlay`](DatePickerOverlay) is pressed. + /// The function that produces a message when the submit button of the [`DatePickerOverlay`] is pressed. on_submit: &'a dyn Fn(Date) -> Message, - /// The position of the [`DatePickerOverlay`](DatePickerOverlay). + /// The position of the [`DatePickerOverlay`]. position: Point, - /// The style of the [`DatePickerOverlay`](DatePickerOverlay). + /// The style of the [`DatePickerOverlay`]. style: ::Style, /// The reference to the tree holding the state of this overlay. tree: &'a mut Tree, @@ -72,8 +72,7 @@ where Message: 'static + Clone, Theme: 'a + StyleSheet + button::StyleSheet + text::StyleSheet + container::StyleSheet, { - /// Creates a new [`DatePickerOverlay`](DatePickerOverlay) on the given - /// position. + /// Creates a new [`DatePickerOverlay`] on the given position. pub fn new( state: &'a mut date_picker::State, on_cancel: Message, @@ -110,8 +109,7 @@ where } } - /// Turn this [`DatePickerOverlay`](DatePickerOverlay) into an overlay - /// [`Element`](overlay::Element). + /// Turn this [`DatePickerOverlay`] into an overlay [`Element`](overlay::Element). #[must_use] pub fn overlay(self) -> overlay::Element<'a, Message, Renderer> { overlay::Element::new(self.position, Box::new(self)) @@ -865,12 +863,12 @@ where } } -/// The state of the [`DatePickerOverlay`](DatePickerOverlay). +/// The state of the [`DatePickerOverlay`]. #[derive(Debug)] pub struct State { - /// The selected date of the [`DatePickerOverlay`](DatePickerOverlay). + /// The selected date of the [`DatePickerOverlay`]. pub(crate) date: NaiveDate, - /// The focus of the [`DatePickerOverlay`](DatePickerOverlay). + /// The focus of the [`DatePickerOverlay`]. pub(crate) focus: Focus, /// The previously pressed keyboard modifiers. pub(crate) keyboard_modifiers: keyboard::Modifiers, @@ -904,9 +902,9 @@ where Message: Clone, Theme: StyleSheet + button::StyleSheet, { - /// The cancel button of the [`DatePickerOverlay`](DatePickerOverlay). + /// The cancel button of the [`DatePickerOverlay`]. cancel_button: Element<'a, Message, Renderer>, - /// The submit button of the [`DatePickerOverlay`](DatePickerOverlay). + /// The submit button of the [`DatePickerOverlay`]. submit_button: Element<'a, Message, Renderer>, } @@ -990,7 +988,7 @@ where } } -/// An enumeration of all focusable elements of the [`DatePickerOverlay`](DatePickerOverlay). +/// An enumeration of all focusable elements of the [`DatePickerOverlay`]. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Focus { /// Nothing is in focus. diff --git a/src/native/overlay/time_picker.rs b/src/native/overlay/time_picker.rs index 10a7070a..24164483 100644 --- a/src/native/overlay/time_picker.rs +++ b/src/native/overlay/time_picker.rs @@ -59,17 +59,17 @@ where Message: Clone, Theme: StyleSheet + button::StyleSheet, { - /// The state of the [`TimePickerOverlay`](TimePickerOverlay). + /// The state of the [`TimePickerOverlay`]. state: &'a mut State, - /// The cancel button of the [`TimePickerOverlay`](TimePickerOverlay). + /// The cancel button of the [`TimePickerOverlay`]. cancel_button: Button<'a, Message, Renderer>, - /// The submit button of the [`TimePickerOverlay`](TimePickerOverlay). + /// The submit button of the [`TimePickerOverlay`]. submit_button: Button<'a, Message, Renderer>, /// The function that produces a message when the submit button of the [`TimePickerOverlay`] is pressed. on_submit: &'a dyn Fn(Time) -> Message, - /// The position of the [`TimePickerOverlay`](TimePickerOverlay). + /// The position of the [`TimePickerOverlay`]. position: Point, - /// The style of the [`TimePickerOverlay`](TimePickerOverlay). + /// The style of the [`TimePickerOverlay`]. style: ::Style, /// The reference to the tree holding the state of this overlay. tree: &'a mut Tree, @@ -80,8 +80,7 @@ where Message: 'static + Clone, Theme: 'a + StyleSheet + button::StyleSheet + text::StyleSheet + container::StyleSheet, { - /// Creates a new [`TimePickerOverlay`](TimePickerOverlay) on the given - /// position. + /// Creates a new [`TimePickerOverlay`] on the given position. pub fn new( state: &'a mut time_picker::State, on_cancel: Message, @@ -117,8 +116,7 @@ where } } - /// Turn this [`TimePickerOverlay`](TimePickerOverlay) into an overlay - /// [`Element`](overlay::Element). + /// Turn this [`TimePickerOverlay`] into an overlay [`Element`](overlay::Element). #[must_use] pub fn overlay(self) -> overlay::Element<'a, Message, Renderer> { overlay::Element::new(self.position, Box::new(self)) @@ -1599,22 +1597,22 @@ fn draw_digital_clock( } } -/// The state of the [`TimePickerOverlay`](TimePickerOverlay). +/// The state of the [`TimePickerOverlay`]. #[derive(Debug)] pub struct State { - /// The selected time of the [`TimePickerOverlay`](TimePickerOverlay). + /// The selected time of the [`TimePickerOverlay`]. pub(crate) time: NaiveTime, /// Toggle if the cache needs to be cleared. pub(crate) clock_cache_needs_clearance: bool, - /// The cache of the clock of the [`TimePickerOverlay`](TimePickerOverlay). + /// The cache of the clock of the [`TimePickerOverlay`]. pub(crate) clock_cache: canvas::Cache, - /// Toggle the use of the 24h clock of the [`TimePickerOverlay`](TimePickerOverlay). + /// Toggle the use of the 24h clock of the [`TimePickerOverlay`]. pub(crate) use_24h: bool, - /// Toggle the use of the seconds of the [`TimePickerOverlay`](TimePickerOverlay). + /// Toggle the use of the seconds of the [`TimePickerOverlay`]. pub(crate) show_seconds: bool, - /// The dragged clock element of the [`TimePickerOverlay`](TimePickerOverlay). + /// The dragged clock element of the [`TimePickerOverlay`]. pub(crate) clock_dragged: ClockDragged, - /// The focus of the [`TimePickerOverlay`](TimePickerOverlay). + /// The focus of the [`TimePickerOverlay`]. pub(crate) focus: Focus, /// The previously pressed keyboard modifiers. pub(crate) keyboard_modifiers: keyboard::Modifiers, @@ -1653,9 +1651,9 @@ where Message: Clone, Theme: StyleSheet + button::StyleSheet, { - /// The cancel button of the [`TimePickerOverlay`](TimePickerOverlay). + /// The cancel button of the [`TimePickerOverlay`]. cancel_button: Element<'a, Message, Renderer>, - /// The submit button of the [`TimePickerOverlay`](TimePickerOverlay). + /// The submit button of the [`TimePickerOverlay`]. submit_button: Element<'a, Message, Renderer>, } @@ -1755,7 +1753,7 @@ pub enum ClockDragged { Second, } -/// An enumeration of all focusable elements of the [`TimePickerOverlay`](TimePickerOverlay). +/// An enumeration of all focusable elements of the [`TimePickerOverlay`]. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Focus { /// Nothing is in focus. diff --git a/src/native/selection_list.rs b/src/native/selection_list.rs index 48081113..1a8506a2 100644 --- a/src/native/selection_list.rs +++ b/src/native/selection_list.rs @@ -124,21 +124,21 @@ where } } - /// Sets the width of the [`SelectionList`](SelectionList). + /// Sets the width of the [`SelectionList`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`SelectionList`](SelectionList). + /// Sets the height of the [`SelectionList`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the style of the [`SelectionList`](SelectionList). + /// Sets the style of the [`SelectionList`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; diff --git a/src/native/spinner.rs b/src/native/spinner.rs index 4abeb12a..27ddb16c 100644 --- a/src/native/spinner.rs +++ b/src/native/spinner.rs @@ -26,11 +26,11 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// The width of the [`Spinner`](Spinner). + /// The width of the [`Spinner`]. width: Length, - /// The height of the [`Spinner`](Spinner). + /// The height of the [`Spinner`]. height: Length, - /// The rate of the [`Spinner`](Spinner). + /// The rate of the [`Spinner`]. rate: Duration, /// The radius of the spinning circle. circle_radius: f32, @@ -65,14 +65,14 @@ where Self::default() } - /// Sets the width of the [`Spinner`](Spinner). + /// Sets the width of the [`Spinner`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`Spinner`](Spinner). + /// Sets the height of the [`Spinner`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; diff --git a/src/native/split.rs b/src/native/split.rs index ebe48ef3..86d845e9 100644 --- a/src/native/split.rs +++ b/src/native/split.rs @@ -44,30 +44,30 @@ where Renderer: core::Renderer, Renderer::Theme: StyleSheet, { - /// The first element of the [`Split`](Split). + /// The first element of the [`Split`]. first: Element<'a, Message, Renderer>, - /// The second element of the [`Split`](Split). + /// The second element of the [`Split`]. second: Element<'a, Message, Renderer>, /// The position of the divider. divider_position: Option, /// The axis to split at. axis: Axis, - /// The padding around the elements of the [`Split`](Split). + /// The padding around the elements of the [`Split`]. padding: f32, - /// The spacing between the elements of the [`Split`](Split). + /// The spacing between the elements of the [`Split`]. /// This is also the width of the divider. spacing: f32, - /// The width of the [`Split`](Split). + /// The width of the [`Split`]. width: Length, - /// The height of the [`Split`](Split). + /// The height of the [`Split`]. height: Length, - /// The minimum size of the first element of the [`Split`](Split). + /// The minimum size of the first element of the [`Split`]. min_size_first: u16, - /// The minimum size of the second element of the [`Split`](Split). + /// The minimum size of the second element of the [`Split`]. min_size_second: u16, - /// The message that is send when the divider of the [`Split`](Split) is moved. + /// The message that is send when the divider of the [`Split`] is moved. on_resize: Box Message>, - /// The style of the [`Split`](Split). + /// The style of the [`Split`]. style: ::Style, } @@ -77,13 +77,13 @@ where Renderer: 'a + core::Renderer, Renderer::Theme: StyleSheet + container::StyleSheet, { - /// Creates a new [`Split`](Split). + /// Creates a new [`Split`]. /// /// It expects: - /// - The first [`Element`](Element) to display - /// - The second [`Element`](Element) to display + /// - The first [`Element`] to display + /// - The second [`Element`] to display /// - The position of the divider. If none, the space will be split in half. - /// - The [`Axis`](Axis) to split at. + /// - The [`Axis`] to split at. /// - The message that is send on moving the divider pub fn new( first: A, @@ -119,14 +119,14 @@ where } } - /// Sets the padding of the [`Split`](Split) around the inner elements. + /// Sets the padding of the [`Split`] around the inner elements. #[must_use] pub fn padding(mut self, padding: f32) -> Self { self.padding = padding; self } - /// Sets the spacing of the [`Split`](Split) between the elements. + /// Sets the spacing of the [`Split`] between the elements. /// This will also be the width of the divider. #[must_use] pub fn spacing(mut self, spacing: f32) -> Self { @@ -134,35 +134,35 @@ where self } - /// Sets the width of the [`Split`](Split). + /// Sets the width of the [`Split`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`Split`](Split). + /// Sets the height of the [`Split`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the minimum size of the first element of the [`Split`](Split). + /// Sets the minimum size of the first element of the [`Split`]. #[must_use] pub fn min_size_first(mut self, size: u16) -> Self { self.min_size_first = size; self } - /// Sets the minimum size of the second element of the [`Split`](Split). + /// Sets the minimum size of the second element of the [`Split`]. #[must_use] pub fn min_size_second(mut self, size: u16) -> Self { self.min_size_second = size; self } - /// Sets the style of the [`Split`](Split). + /// Sets the style of the [`Split`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; @@ -661,7 +661,7 @@ where } } -/// The state of a [`Split`](Split). +/// The state of a [`Split`]. #[derive(Clone, Debug, Default)] pub struct SplitState { /// If the divider is dragged by the user. @@ -669,11 +669,11 @@ pub struct SplitState { } impl SplitState { - /// Creates a new [`State`](State) for a [`Split`](Split). + /// Creates a new [`State`] for a [`Split`]. /// /// It expects: /// - The optional position of the divider. If none, the available space will be split in half. - /// - The [`Axis`](Axis) to split at. + /// - The [`Axis`] to split at. #[must_use] pub const fn new() -> Self { Self { dragging: false } diff --git a/src/native/tab_bar.rs b/src/native/tab_bar.rs index 74d5fddc..00fc8cdd 100644 --- a/src/native/tab_bar.rs +++ b/src/native/tab_bar.rs @@ -1,4 +1,4 @@ -//! Displays a [`TabBar`](TabBar) to select the content to be displayed. +//! Displays a [`TabBar`] to select the content to be displayed. //! //! You have to manage the logic to show the contend by yourself or you may want //! to use the [`Tabs`](super::tabs::Tabs) widget instead. @@ -80,13 +80,13 @@ where on_select: Box Message>, /// The function that produces the message when the close icon was pressed. on_close: Option Message>>, - /// The width of the [`TabBar`](TabBar). + /// The width of the [`TabBar`]. width: Length, - /// The width of the tabs of the [`TabBar`](TabBar). + /// The width of the tabs of the [`TabBar`]. tab_width: Length, - /// The width of the [`TabBar`](TabBar). + /// The width of the [`TabBar`]. height: Length, - /// The maximum height of the [`TabBar`](TabBar). + /// The maximum height of the [`TabBar`]. max_height: f32, /// The icon size. icon_size: f32, @@ -94,15 +94,15 @@ where text_size: f32, /// The size of the close icon. close_size: f32, - /// The padding of the tabs of the [`TabBar`](TabBar). + /// The padding of the tabs of the [`TabBar`]. padding: f32, - /// The spacing of the tabs of the [`TabBar`](TabBar). + /// The spacing of the tabs of the [`TabBar`]. spacing: f32, - /// The optional icon font of the [`TabBar`](TabBar). + /// The optional icon font of the [`TabBar`]. icon_font: Option, - /// The optional text font of the [`TabBar`](TabBar). + /// The optional text font of the [`TabBar`]. text_font: Option, - /// The style of the [`TabBar`](TabBar). + /// The style of the [`TabBar`]. style: ::Style, #[allow(clippy::missing_docs_in_private_items)] _renderer: PhantomData, @@ -114,8 +114,8 @@ where Renderer::Theme: StyleSheet, TabId: Eq + Clone, { - /// Creates a new [`TabBar`](TabBar) with the index of the selected tab and a - /// specified message which will be send when a tab is selected by the user. + /// Creates a new [`TabBar`] with the index of the selected tab and a specified + /// message which will be send when a tab is selected by the user. /// /// It expects: /// * the index of the currently active tab. @@ -128,12 +128,11 @@ where Self::with_tab_labels(Vec::new(), on_select) } - /// Similar to `new` but with a given Vector of the - /// [`TabLabel`](crate::tab_bar::TabLabel)s.Alignment + /// Similar to `new` but with a given Vector of the [`TabLabel`](crate::tab_bar::TabLabel)s. /// /// It expects: /// * the index of the currently active tab. - /// * a vector containing the [`TabLabel`](TabLabel)s of the [`TabBar`](TabBar). + /// * a vector containing the [`TabLabel`]s of the [`TabBar`]. /// * the function that will be called if a tab is selected by the user. /// It takes the index of the selected tab. pub fn with_tab_labels(tab_labels: Vec<(TabId, TabLabel)>, on_select: F) -> Self @@ -162,26 +161,26 @@ where } } - /// Gets the index of the currently active tab on the [`TabBar`](TabBar). + /// Gets the index of the currently active tab on the [`TabBar`]. #[must_use] pub fn get_active_tab_idx(&self) -> usize { self.active_tab } - /// Gets the id of the currently active tab on the [`TabBar`](TabBar). + /// Gets the id of the currently active tab on the [`TabBar`]. #[must_use] pub fn get_active_tab_id(&self) -> Option<&TabId> { self.tab_indices.get(self.active_tab) } - /// Gets the amount of tabs on the [`TabBar`](TabBar). + /// Gets the amount of tabs on the [`TabBar`]. #[must_use] pub fn size(&self) -> usize { self.tab_indices.len() } /// Sets the message that will be produced when the close icon of a tab - /// on the [`TabBar`](TabBar) is pressed. + /// on the [`TabBar`] is pressed. /// /// Setting this enables the drawing of a close icon on the tabs. #[must_use] @@ -193,56 +192,54 @@ where self } - /// Sets the width of the [`TabBar`](TabBar). + /// Sets the width of the [`TabBar`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Gets the width of the [`TabBar`](TabBar). + /// Gets the width of the [`TabBar`]. #[must_use] pub fn get_width(&self) -> Length { self.width } - /// Sets the width of a tab on the [`TabBar`](TabBar). + /// Sets the width of a tab on the [`TabBar`]. #[must_use] pub fn tab_width(mut self, width: Length) -> Self { self.tab_width = width; self } - /// Sets the height of the [`TabBar`](TabBar). + /// Sets the height of the [`TabBar`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Gets the width of the [`TabBar`](TabBar). + /// Gets the width of the [`TabBar`]. #[must_use] pub fn get_height(&self) -> Length { self.height } - /// Sets the maximum height of the [`TabBar`](TabBar). + /// Sets the maximum height of the [`TabBar`]. #[must_use] pub fn max_height(mut self, max_height: f32) -> Self { self.max_height = max_height; self } - /// Sets the icon size of the [`TabLabel`](crate::tab_bar::TabLabel)s of - /// the [`TabBar`](TabBar). + /// Sets the icon size of the [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`]. #[must_use] pub fn icon_size(mut self, icon_size: f32) -> Self { self.icon_size = icon_size; self } - /// Sets the text size of the [`TabLabel`](crate::tab_bar::TabLabel)s of the - /// [`TabBar`](TabBar). + /// Sets the text size of the [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`]. #[must_use] pub fn text_size(mut self, text_size: f32) -> Self { self.text_size = text_size; @@ -250,21 +247,21 @@ where } /// Sets the size of the close icon of the - /// [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`](TabBar). + /// [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`]. #[must_use] pub fn close_size(mut self, close_size: f32) -> Self { self.close_size = close_size; self } - /// Sets the padding of the tabs of the [`TabBar`](TabBar). + /// Sets the padding of the tabs of the [`TabBar`]. #[must_use] pub fn padding(mut self, padding: f32) -> Self { self.padding = padding; self } - /// Sets the spacing between the tabs of the [`TabBar`](TabBar). + /// Sets the spacing between the tabs of the [`TabBar`]. #[must_use] pub fn spacing(mut self, spacing: f32) -> Self { self.spacing = spacing; @@ -272,7 +269,7 @@ where } /// Sets the font of the icons of the - /// [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`](TabBar). + /// [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`]. #[must_use] pub fn icon_font(mut self, icon_font: Font) -> Self { self.icon_font = Some(icon_font); @@ -280,21 +277,21 @@ where } /// Sets the font of the text of the - /// [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`](TabBar). + /// [`TabLabel`](crate::tab_bar::TabLabel)s of the [`TabBar`]. #[must_use] pub fn text_font(mut self, text_font: Font) -> Self { self.text_font = Some(text_font); self } - /// Sets the style of the [`TabBar`](TabBar). + /// Sets the style of the [`TabBar`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; self } - /// Pushes a [`TabLabel`](crate::tab_bar::TabLabel) to the [`TabBar`](TabBar). + /// Pushes a [`TabLabel`](crate::tab_bar::TabLabel) to the [`TabBar`]. #[must_use] pub fn push(mut self, id: TabId, tab_label: TabLabel) -> Self { self.tab_labels.push(tab_label); @@ -302,7 +299,7 @@ where self } - /// Sets up the active tab on the [`TabBar`](TabBar). + /// Sets up the active tab on the [`TabBar`]. #[must_use] pub fn set_active_tab(mut self, active_tab: &TabId) -> Self { self.active_tab = self diff --git a/src/native/tab_bar/tab_label.rs b/src/native/tab_bar/tab_label.rs index 5c786a5d..eddd2336 100644 --- a/src/native/tab_bar/tab_label.rs +++ b/src/native/tab_bar/tab_label.rs @@ -1,19 +1,19 @@ -//! A [`TabLabel`](TabLabel) showing an icon and/or a text on a tab. +//! A [`TabLabel`] showing an icon and/or a text on a tab. //! //! *This API requires the following crate features to be activated: `tab_bar`* -/// A [`TabLabel`](TabLabel) showing an icon and/or a text on a tab +/// A [`TabLabel`] showing an icon and/or a text on a tab /// on a [`TabBar`](super::TabBar). #[allow(missing_debug_implementations)] #[derive(Clone, Hash)] pub enum TabLabel { - /// A [`TabLabel`](TabLabel) showing only an icon on the tab. + /// A [`TabLabel`] showing only an icon on the tab. Icon(char), - /// A [`TabLabel`](TabLabel) showing only a text on the tab. + /// A [`TabLabel`] showing only a text on the tab. Text(String), - /// A [`TabLabel`](TabLabel) showing an icon and a text on the tab. + /// A [`TabLabel`] showing an icon and a text on the tab. IconText(char, String), // TODO: Support any element as a label. } diff --git a/src/native/tabs.rs b/src/native/tabs.rs index b3d05c1d..0aa0ce0c 100644 --- a/src/native/tabs.rs +++ b/src/native/tabs.rs @@ -1,4 +1,4 @@ -//! Displays a [`Tabs`](Tabs) widget to select the content to be displayed. +//! Displays a [`Tabs`] widget to select the content to be displayed. //! //! This is a wrapper around the [`TabBar`](super::tab_bar::TabBar) widget. //! Unlike the [`TabBar`](super::tab_bar::TabBar) widget it will also handle @@ -24,7 +24,7 @@ use crate::{native::tab_bar::TabBar, style::tab_bar::StyleSheet, TabLabel}; pub mod tab_bar_position; pub use tab_bar_position::TabBarPosition; -/// A [`Tabs`](Tabs) widget for showing a [`TabBar`](super::tab_bar::TabBar) +/// A [`Tabs`] widget for showing a [`TabBar`](super::tab_bar::TabBar) /// along with the tab's content. /// /// # Example @@ -58,7 +58,7 @@ where Renderer::Theme: StyleSheet, TabId: Eq + Clone, { - /// The [`TabBar`](crate::native::TabBar) of the [`Tabs`](Tabs). + /// The [`TabBar`](crate::native::TabBar) of the [`Tabs`]. tab_bar: TabBar, /// The vector containing the content of the tabs. tabs: Vec>, @@ -66,9 +66,9 @@ where indices: Vec, /// The position of the [`TabBar`](crate::native::TabBar). tab_bar_position: TabBarPosition, - /// the width of the [`Tabs`](Tabs). + /// the width of the [`Tabs`]. width: Length, - /// The height of the [`Tabs`](Tabs). + /// The height of the [`Tabs`]. height: Length, } @@ -78,9 +78,8 @@ where Renderer::Theme: StyleSheet + text::StyleSheet, TabId: Eq + Clone, { - /// Creates a new [`Tabs`](Tabs) widget with the index of the selected tab - /// and a specified message which will be send when a tab is selected by - /// the user. + /// Creates a new [`Tabs`] widget with the index of the selected tab and a + /// specified message which will be send when a tab is selected by the user. /// /// It expects: /// * the index of the currently active tab. @@ -98,8 +97,8 @@ where /// /// It expects: /// * the index of the currently active tab. - /// * a vector containing the [`TabLabel`](TabLabel)s along with the content - /// [`Element`]s of the [`Tabs`](Tabs). + /// * a vector containing the [`TabLabel`]s along with the content + /// [`Element`]s of the [`Tabs`]. /// * the function that will be called if a tab is selected by the user. /// It takes the index of the selected tab. pub fn with_tabs( @@ -130,7 +129,7 @@ where } /// Sets the message that will be produced when the close icon of a tab - /// on the [`TabBar`](TabBar) is pressed. + /// on the [`TabBar`] is pressed. /// /// Setting this enables the drawing of a close icon on the tabs. #[must_use] @@ -142,38 +141,35 @@ where self } - /// Sets the width of the [`Tabs`](Tabs). + /// Sets the width of the [`Tabs`]. #[must_use] pub fn width(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`Tabs`](Tabs). + /// Sets the height of the [`Tabs`]. #[must_use] pub fn height(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the width of the [`TabBar`](super::tab_bar::TabBar) of the - /// [`Tabs`](Tabs). + /// Sets the width of the [`TabBar`](super::tab_bar::TabBar) of the [`Tabs`]. #[must_use] pub fn tab_bar_width(mut self, width: Length) -> Self { self.tab_bar = self.tab_bar.width(width); self } - /// Sets the height of the [`TabBar`](super::tab_bar::TabBar) of the - /// [`Tabs`](Tabs). + /// Sets the height of the [`TabBar`](super::tab_bar::TabBar) of the [`Tabs`]. #[must_use] pub fn tab_bar_height(mut self, height: Length) -> Self { self.tab_bar = self.tab_bar.height(height); self } - /// Sets the maximum height of the [`TabBar`](super::tab_bar::TabBar) of the - /// [`Tabs`](Tabs). + /// Sets the maximum height of the [`TabBar`](super::tab_bar::TabBar) of the [`Tabs`]. #[must_use] pub fn tab_bar_max_height(mut self, max_height: f32) -> Self { self.tab_bar = self.tab_bar.max_height(max_height); @@ -245,8 +241,7 @@ where self } - /// Sets the [`TabBarPosition`](TabBarPosition) of the - /// [`TabBar`](super::tab_bar::TabBar). + /// Sets the [`TabBarPosition`] of the [`TabBar`](super::tab_bar::TabBar). #[must_use] pub fn tab_bar_position(mut self, position: TabBarPosition) -> Self { self.tab_bar_position = position; @@ -254,7 +249,7 @@ where } /// Pushes a [`TabLabel`](super::tab_bar::TabLabel) along with the tabs - /// content to the [`Tabs`](Tabs). + /// content to the [`Tabs`]. #[must_use] pub fn push(mut self, id: TabId, tab_label: TabLabel, element: E) -> Self where @@ -266,7 +261,7 @@ where self } - /// Sets the active tab of the [`Tabs`](Tabs) using the ``TabId``. + /// Sets the active tab of the [`Tabs`] using the ``TabId``. #[must_use] pub fn set_active_tab(mut self, id: &TabId) -> Self { self.tab_bar = self.tab_bar.set_active_tab(id); diff --git a/src/native/tabs/tab_bar_position.rs b/src/native/tabs/tab_bar_position.rs index 826a8c6a..1419d266 100644 --- a/src/native/tabs/tab_bar_position.rs +++ b/src/native/tabs/tab_bar_position.rs @@ -1,18 +1,16 @@ -//! A [`TabBarPosition`](TabBarPosition) for defining the position of a -//! [`TabBar`](crate::native::tab_bar::TabBar). +//! A [`TabBarPosition`] for defining the position of a [`TabBar`](crate::native::tab_bar::TabBar). //! //! *This API requires the following crate features to be activated: tabs* -/// A [`TabBarPosition`](TabBarPosition) for defining the position of a -/// [`TabBar`](crate::native::tab_bar::TabBar). +/// A [`TabBarPosition`] for defining the position of a [`TabBar`](crate::native::tab_bar::TabBar). #[derive(Clone, Hash)] #[allow(missing_debug_implementations)] pub enum TabBarPosition { - /// A [`TabBarPosition`] for placing the - /// [`TabBar`](crate::native::tab_bar::TabBar) on top of its content. + /// A [`TabBarPosition`] for placing the [`TabBar`](crate::native::tab_bar::TabBar) + /// on top of its content. Top, - /// A [`TabBarPosition`] for placing the - /// [`TabBar`](crate::native::tab_bar::TabBar) on bottom of its content. + /// A [`TabBarPosition`] for placing the [`TabBar`](crate::native::tab_bar::TabBar) + /// on bottom of its content. Bottom, } diff --git a/src/native/time_picker.rs b/src/native/time_picker.rs index 623cf19a..85951843 100644 --- a/src/native/time_picker.rs +++ b/src/native/time_picker.rs @@ -59,17 +59,17 @@ where time: Time, /// The underlying element. underlay: Element<'a, Message, Renderer>, - /// The message that is send if the cancel button of the [`TimePickerOverlay`](TimePickerOverlay) is pressed. + /// The message that is send if the cancel button of the [`TimePickerOverlay`] is pressed. on_cancel: Message, - /// The function that produces a message when the submit button of the [`TimePickerOverlay`](TimePickerOverlay) is pressed. + /// The function that produces a message when the submit button of the [`TimePickerOverlay`] is pressed. on_submit: Box Message>, - /// The style of the [`TimePickerOverlay`](TimePickerOverlay). + /// The style of the [`TimePickerOverlay`]. style: ::Style, /// The buttons of the overlay. overlay_state: Element<'a, Message, Renderer>, - /// Toggle the use of the 24h clock of the [`TimePickerOverlay`](TimePickerOverlay). + /// Toggle the use of the 24h clock of the [`TimePickerOverlay`]. use_24h: bool, - /// Toggle the use of the seconds of the [`TimePickerOverlay`](TimePickerOverlay). + /// Toggle the use of the seconds of the [`TimePickerOverlay`]. show_seconds: bool, } @@ -78,16 +78,15 @@ where Message: 'a + Clone, Theme: 'a + StyleSheet + button::StyleSheet + text::StyleSheet, { - /// Creates a new [`TimePicker`](TimePicker) wrapping around the given underlay. + /// Creates a new [`TimePicker`] wrapping around the given underlay. /// /// It expects: /// * if the overlay of the time picker is visible. /// * the initial time to show. - /// * the underlay [`Element`] on which this [`TimePicker`](TimePicker) + /// * the underlay [`Element`] on which this [`TimePicker`] /// will be wrapped around. - /// * a message that will be send when the cancel button of the [`TimePicker`](TimePicker) - /// is pressed. - /// * a function that will be called when the submit button of the [`TimePicker`](TimePicker) + /// * a message that will be send when the cancel button of the [`TimePicker`] is pressed. + /// * a function that will be called when the submit button of the [`TimePicker`] /// is pressed, which takes the picked [`Time`](crate::time_picker::Time) value. pub fn new( show_picker: bool, @@ -127,7 +126,7 @@ where self } - /// Sets the style of the [`TimePicker`](TimePicker). + /// Sets the style of the [`TimePicker`]. #[must_use] pub fn style(mut self, style: ::Style) -> Self { self.style = style; @@ -135,7 +134,7 @@ where } } -/// The state of the [`TimePicker`](TimePicker) / [`TimePickerOverlay`](TimePickerOverlay). +/// The state of the [`TimePicker`] / [`TimePickerOverlay`]. #[derive(Debug)] pub struct State { /// The state of the overlay. @@ -143,7 +142,7 @@ pub struct State { } impl State { - /// Creates a new [`State`](State) with the current time. + /// Creates a new [`State`] with the current time. #[must_use] pub fn now() -> Self { Self { @@ -151,7 +150,7 @@ impl State { } } - /// Creates a new [`State`](State) with the given time. + /// Creates a new [`State`] with the given time. #[must_use] pub fn new(time: Time) -> Self { Self { diff --git a/src/native/wrap.rs b/src/native/wrap.rs index 27f788e1..734bb834 100644 --- a/src/native/wrap.rs +++ b/src/native/wrap.rs @@ -18,39 +18,39 @@ use std::marker::PhantomData; pub struct Wrap<'a, Message, Direction, Renderer = crate::Renderer> { /// The elements to distribute. pub elements: Vec>, - /// The alignment of the [`Wrap`](Wrap). + /// The alignment of the [`Wrap`]. pub alignment: Alignment, - /// The width of the [`Wrap`](Wrap). + /// The width of the [`Wrap`]. pub width: Length, - /// The height of the [`Wrap`](Wrap). + /// The height of the [`Wrap`]. pub height: Length, - /// The maximum width of the [`Wrap`](Wrap). + /// The maximum width of the [`Wrap`]. pub max_width: f32, - /// The maximum height of the [`Wrap`](Wrap) + /// The maximum height of the [`Wrap`]. pub max_height: f32, - /// The padding of each element of the [`Wrap`](Wrap). + /// The padding of each element of the [`Wrap`]. pub padding: f32, - /// The spacing between each element of the [`Wrap`](Wrap). + /// The spacing between each element of the [`Wrap`]. pub spacing: f32, - /// The spacing between each line of the [`Wrap`](Wrap). + /// The spacing between each line of the [`Wrap`]. pub line_spacing: f32, - /// The minimal length of each line of the [`Wrap`](Wrap). + /// The minimal length of each line of the [`Wrap`]. pub line_minimal_length: f32, #[allow(clippy::missing_docs_in_private_items)] _direction: PhantomData, } impl<'a, Message, Renderer> Wrap<'a, Message, direction::Horizontal, Renderer> { - /// Creates an empty horizontal [`Wrap`](Wrap). + /// Creates an empty horizontal [`Wrap`]. #[must_use] pub fn new() -> Self { Self::with_elements(Vec::new()) } - /// Creates a [`Wrap`](Wrap) with the given elements. + /// Creates a [`Wrap`] with the given elements. /// /// It expects: - /// * the vector containing the [`Element`]s for this [`Wrap`](Wrap). + /// * the vector containing the [`Element`]s for this [`Wrap`]. #[must_use] pub fn with_elements(elements: Vec>) -> Self { Self { @@ -61,16 +61,16 @@ impl<'a, Message, Renderer> Wrap<'a, Message, direction::Horizontal, Renderer> { } impl<'a, Message, Renderer> Wrap<'a, Message, direction::Vertical, Renderer> { - /// Creates an empty vertical [`Wrap`](Wrap). + /// Creates an empty vertical [`Wrap`]. #[must_use] pub fn new_vertical() -> Self { Self::with_elements_vertical(Vec::new()) } - /// Creates a [`Wrap`](Wrap) with the given elements. + /// Creates a [`Wrap`] with the given elements. /// /// It expects: - /// * the vector containing the [`Element`]s for this [`Wrap`](Wrap). + /// * the vector containing the [`Element`]s for this [`Wrap`]. #[must_use] pub fn with_elements_vertical(elements: Vec>) -> Self { Self { @@ -81,70 +81,70 @@ impl<'a, Message, Renderer> Wrap<'a, Message, direction::Vertical, Renderer> { } impl<'a, Message, Renderer, Direction> Wrap<'a, Message, Direction, Renderer> { - /// Sets the spacing of the [`Wrap`](Wrap). + /// Sets the spacing of the [`Wrap`]. #[must_use] pub const fn spacing(mut self, units: f32) -> Self { self.spacing = units; self } - /// Sets the spacing of the lines of the [`Wrap`](Wrap). + /// Sets the spacing of the lines of the [`Wrap`]. #[must_use] pub const fn line_spacing(mut self, units: f32) -> Self { self.line_spacing = units; self } - /// Sets the minimal length of the lines of the [`Wrap`](Wrap). + /// Sets the minimal length of the lines of the [`Wrap`]. #[must_use] pub const fn line_minimal_length(mut self, units: f32) -> Self { self.line_minimal_length = units; self } - /// Sets the padding of the elements in the [`Wrap`](Wrap). + /// Sets the padding of the elements in the [`Wrap`]. #[must_use] pub const fn padding(mut self, units: f32) -> Self { self.padding = units; self } - /// Sets the width of the [`Wrap`](Wrap). + /// Sets the width of the [`Wrap`]. #[must_use] pub const fn width_items(mut self, width: Length) -> Self { self.width = width; self } - /// Sets the height of the [`Wrap`](Wrap). + /// Sets the height of the [`Wrap`]. #[must_use] pub const fn height_items(mut self, height: Length) -> Self { self.height = height; self } - /// Sets the maximum width of the [`Wrap`](Wrap). + /// Sets the maximum width of the [`Wrap`]. #[must_use] pub const fn max_width(mut self, max_width: f32) -> Self { self.max_width = max_width; self } - /// Sets the maximum height of the [`Wrap`](Wrap). + /// Sets the maximum height of the [`Wrap`]. #[must_use] pub const fn max_height(mut self, max_height: f32) -> Self { self.max_height = max_height; self } - /// Sets the alignment of the [`Wrap`](Wrap). + /// Sets the alignment of the [`Wrap`]. #[must_use] pub const fn align_items(mut self, align: Alignment) -> Self { self.alignment = align; self } - /// Pushes an [`Element`] to the [`Wrap`](Wrap). + /// Pushes an [`Element`] to the [`Wrap`]. #[must_use] pub fn push(mut self, element: E) -> Self where @@ -332,12 +332,12 @@ impl<'a, Message, Renderer, Direction> Default for Wrap<'a, Message, Direction, } } } -/// A inner layout of the [`Wrap`](Wrap). +/// A inner layout of the [`Wrap`]. pub trait WrapLayout where Renderer: core::Renderer, { - /// A inner layout of the [`Wrap`](Wrap). + /// A inner layout of the [`Wrap`]. fn inner_layout(&self, renderer: &Renderer, limits: &Limits) -> Node; }