diff options
author | 2022-05-02 21:21:24 +0200 | |
---|---|---|
committer | 2022-05-02 21:21:24 +0200 | |
commit | 5acba65c1135d8ebbda94efc74ea0bebb29c438a (patch) | |
tree | 88673403313ad90cec226ee92d4ebf4ef0a24bdc /native/src/widget | |
parent | a17a7103d382f02c64e7b271d953ea6babffac97 (diff) | |
parent | 7e111f273fb22a6ffc7a4fd24bea5e838d276758 (diff) | |
download | iced-5acba65c1135d8ebbda94efc74ea0bebb29c438a.tar.gz iced-5acba65c1135d8ebbda94efc74ea0bebb29c438a.tar.bz2 iced-5acba65c1135d8ebbda94efc74ea0bebb29c438a.zip |
Merge pull request #1327 from iced-rs/update-docs
Update documentation
Diffstat (limited to 'native/src/widget')
-rw-r--r-- | native/src/widget/checkbox.rs | 2 | ||||
-rw-r--r-- | native/src/widget/column.rs | 2 | ||||
-rw-r--r-- | native/src/widget/pane_grid.rs | 2 | ||||
-rw-r--r-- | native/src/widget/pane_grid/configuration.rs | 4 | ||||
-rw-r--r-- | native/src/widget/pane_grid/content.rs | 2 | ||||
-rw-r--r-- | native/src/widget/pane_grid/state.rs | 22 | ||||
-rw-r--r-- | native/src/widget/pane_grid/title_bar.rs | 2 | ||||
-rw-r--r-- | native/src/widget/row.rs | 2 | ||||
-rw-r--r-- | native/src/widget/text.rs | 6 | ||||
-rw-r--r-- | native/src/widget/text_input.rs | 9 | ||||
-rw-r--r-- | native/src/widget/toggler.rs | 2 | ||||
-rw-r--r-- | native/src/widget/tooltip.rs | 2 |
12 files changed, 42 insertions, 15 deletions
diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index 122c5e52..b6d920df 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -102,7 +102,7 @@ impl<'a, Message, Renderer: text::Renderer> Checkbox<'a, Message, Renderer> { /// Sets the [`Font`] of the text of the [`Checkbox`]. /// - /// [`Font`]: crate::widget::text::Renderer::Font + /// [`Font`]: crate::text::Renderer::Font pub fn font(mut self, font: Renderer::Font) -> Self { self.font = font; self diff --git a/native/src/widget/column.rs b/native/src/widget/column.rs index f161d1f2..268218b1 100644 --- a/native/src/widget/column.rs +++ b/native/src/widget/column.rs @@ -48,7 +48,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { /// Sets the vertical spacing _between_ elements. /// - /// Custom margins per element do not exist in Iced. You should use this + /// Custom margins per element do not exist in iced. You should use this /// method instead! While less flexible, it helps you keep spacing between /// elements consistent. pub fn spacing(mut self, units: u16) -> Self { diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 2093886e..0ceec83e 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -6,7 +6,7 @@ //! The [`pane_grid` example] showcases how to use a [`PaneGrid`] with resizing, //! drag and drop, and hotkey support. //! -//! [`pane_grid` example]: https://github.com/iced-rs/iced/tree/0.3/examples/pane_grid +//! [`pane_grid` example]: https://github.com/iced-rs/iced/tree/0.4/examples/pane_grid mod axis; mod configuration; mod content; diff --git a/native/src/widget/pane_grid/configuration.rs b/native/src/widget/pane_grid/configuration.rs index 4c52bad4..7d68fb46 100644 --- a/native/src/widget/pane_grid/configuration.rs +++ b/native/src/widget/pane_grid/configuration.rs @@ -2,7 +2,7 @@ use crate::widget::pane_grid::Axis; /// The arrangement of a [`PaneGrid`]. /// -/// [`PaneGrid`]: crate::pane_grid::PaneGrid +/// [`PaneGrid`]: crate::widget::PaneGrid #[derive(Debug, Clone)] pub enum Configuration<T> { /// A split of the available space. @@ -21,6 +21,6 @@ pub enum Configuration<T> { }, /// A [`Pane`]. /// - /// [`Pane`]: crate::pane_grid::Pane + /// [`Pane`]: crate::widget::pane_grid::Pane Pane(T), } diff --git a/native/src/widget/pane_grid/content.rs b/native/src/widget/pane_grid/content.rs index f0ed0426..407f5458 100644 --- a/native/src/widget/pane_grid/content.rs +++ b/native/src/widget/pane_grid/content.rs @@ -55,7 +55,7 @@ where { /// Draws the [`Content`] with the provided [`Renderer`] and [`Layout`]. /// - /// [`Renderer`]: crate::widget::pane_grid::Renderer + /// [`Renderer`]: crate::Renderer pub fn draw( &self, renderer: &mut Renderer, diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs index f9ea21f4..6a282d24 100644 --- a/native/src/widget/pane_grid/state.rs +++ b/native/src/widget/pane_grid/state.rs @@ -1,4 +1,6 @@ //! The state of a [`PaneGrid`]. +//! +//! [`PaneGrid`]: crate::widget::PaneGrid use crate::widget::pane_grid::{ Axis, Configuration, Direction, Node, Pane, Split, }; @@ -21,9 +23,13 @@ use std::collections::{BTreeMap, HashMap}; #[derive(Debug, Clone)] pub struct State<T> { /// The panes of the [`PaneGrid`]. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid pub panes: HashMap<Pane, T>, /// The internal state of the [`PaneGrid`]. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid pub internal: Internal, pub(super) action: Action, @@ -198,6 +204,8 @@ impl<T> State<T> { } /// The internal state of a [`PaneGrid`]. +/// +/// [`PaneGrid`]: crate::widget::PaneGrid #[derive(Debug, Clone)] pub struct Internal { layout: Node, @@ -207,6 +215,8 @@ pub struct Internal { impl Internal { /// Initializes the [`Internal`] state of a [`PaneGrid`] from a /// [`Configuration`]. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid pub fn from_configuration<T>( panes: &mut HashMap<Pane, T>, content: Configuration<T>, @@ -248,11 +258,17 @@ impl Internal { } /// The current action of a [`PaneGrid`]. +/// +/// [`PaneGrid`]: crate::widget::PaneGrid #[derive(Debug, Clone, Copy, PartialEq)] pub enum Action { /// The [`PaneGrid`] is idle. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid Idle, /// A [`Pane`] in the [`PaneGrid`] is being dragged. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid Dragging { /// The [`Pane`] being dragged. pane: Pane, @@ -260,6 +276,8 @@ pub enum Action { origin: Point, }, /// A [`Split`] in the [`PaneGrid`] is being dragged. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid Resizing { /// The [`Split`] being dragged. split: Split, @@ -288,6 +306,8 @@ impl Action { impl Internal { /// Calculates the current [`Pane`] regions from the [`PaneGrid`] layout. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid pub fn pane_regions( &self, spacing: f32, @@ -297,6 +317,8 @@ impl Internal { } /// Calculates the current [`Split`] regions from the [`PaneGrid`] layout. + /// + /// [`PaneGrid`]: crate::widget::PaneGrid pub fn split_regions( &self, spacing: f32, diff --git a/native/src/widget/pane_grid/title_bar.rs b/native/src/widget/pane_grid/title_bar.rs index d56972ec..a10181af 100644 --- a/native/src/widget/pane_grid/title_bar.rs +++ b/native/src/widget/pane_grid/title_bar.rs @@ -82,7 +82,7 @@ where { /// Draws the [`TitleBar`] with the provided [`Renderer`] and [`Layout`]. /// - /// [`Renderer`]: crate::widget::pane_grid::Renderer + /// [`Renderer`]: crate::Renderer pub fn draw( &self, renderer: &mut Renderer, diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs index e34befb2..7a7c70c6 100644 --- a/native/src/widget/row.rs +++ b/native/src/widget/row.rs @@ -48,7 +48,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> { /// Sets the horizontal spacing _between_ elements. /// - /// Custom margins per element do not exist in Iced. You should use this + /// Custom margins per element do not exist in iced. You should use this /// method instead! While less flexible, it helps you keep spacing between /// elements consistent. pub fn spacing(mut self, units: u16) -> Self { diff --git a/native/src/widget/text.rs b/native/src/widget/text.rs index 6f00c9c8..a7855c30 100644 --- a/native/src/widget/text.rs +++ b/native/src/widget/text.rs @@ -59,7 +59,7 @@ impl<Renderer: text::Renderer> Text<Renderer> { /// Sets the [`Font`] of the [`Text`]. /// - /// [`Font`]: Renderer::Font + /// [`Font`]: crate::text::Renderer::Font pub fn font(mut self, font: impl Into<Renderer::Font>) -> Self { self.font = font.into(); self @@ -77,7 +77,7 @@ impl<Renderer: text::Renderer> Text<Renderer> { self } - /// Sets the [`HorizontalAlignment`] of the [`Text`]. + /// Sets the [`alignment::Horizontal`] of the [`Text`]. pub fn horizontal_alignment( mut self, alignment: alignment::Horizontal, @@ -86,7 +86,7 @@ impl<Renderer: text::Renderer> Text<Renderer> { self } - /// Sets the [`VerticalAlignment`] of the [`Text`]. + /// Sets the [`alignment::Vertical`] of the [`Text`]. pub fn vertical_alignment( mut self, alignment: alignment::Vertical, diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index a206a0c7..5ecd68e9 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -108,10 +108,9 @@ where self } - /// Sets the [`Font`] of the [`Text`]. + /// Sets the [`Font`] of the [`TextInput`]. /// - /// [`Font`]: crate::widget::text::Renderer::Font - /// [`Text`]: crate::widget::Text + /// [`Font`]: crate::text::Renderer::Font pub fn font(mut self, font: Renderer::Font) -> Self { self.font = font; self @@ -157,6 +156,8 @@ where /// Draws the [`TextInput`] with the given [`Renderer`], overriding its /// [`Value`] if provided. + /// + /// [`Renderer`]: text::Renderer pub fn draw( &self, renderer: &mut Renderer, @@ -570,6 +571,8 @@ where /// Draws the [`TextInput`] with the given [`Renderer`], overriding its /// [`Value`] if provided. +/// +/// [`Renderer`]: text::Renderer pub fn draw<Renderer>( renderer: &mut Renderer, layout: Layout<'_>, diff --git a/native/src/widget/toggler.rs b/native/src/widget/toggler.rs index 536aef78..6d7592f3 100644 --- a/native/src/widget/toggler.rs +++ b/native/src/widget/toggler.rs @@ -107,6 +107,8 @@ impl<'a, Message, Renderer: text::Renderer> Toggler<'a, Message, Renderer> { } /// Sets the [`Font`] of the text of the [`Toggler`] + /// + /// [`Font`]: crate::text::Renderer::Font pub fn font(mut self, font: Renderer::Font) -> Self { self.font = font; self diff --git a/native/src/widget/tooltip.rs b/native/src/widget/tooltip.rs index e178c8b2..c929395f 100644 --- a/native/src/widget/tooltip.rs +++ b/native/src/widget/tooltip.rs @@ -29,7 +29,7 @@ where /// The default padding of a [`Tooltip`] drawn by this renderer. const DEFAULT_PADDING: u16 = 5; - /// Creates an empty [`Tooltip`]. + /// Creates a new [`Tooltip`]. /// /// [`Tooltip`]: struct.Tooltip.html pub fn new( |