Fix broken documentation links
This commit is contained in:
parent
ff9395838b
commit
1480ab2030
20 changed files with 38 additions and 61 deletions
|
|
@ -9,7 +9,7 @@ use crate::{Color, Point, Size};
|
||||||
/// A fill which transitions colors progressively along a direction, either linearly, radially (TBD),
|
/// A fill which transitions colors progressively along a direction, either linearly, radially (TBD),
|
||||||
/// or conically (TBD).
|
/// or conically (TBD).
|
||||||
pub enum Gradient {
|
pub enum Gradient {
|
||||||
/// A linear gradient interpolates colors along a direction from its [`start`] to its [`end`]
|
/// A linear gradient interpolates colors along a direction from its `start` to its `end`
|
||||||
/// point.
|
/// point.
|
||||||
Linear(Linear),
|
Linear(Linear),
|
||||||
}
|
}
|
||||||
|
|
@ -23,10 +23,15 @@ impl Gradient {
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
/// A point along the gradient vector where the specified [`color`] is unmixed.
|
/// A point along the gradient vector where the specified [`color`] is unmixed.
|
||||||
|
///
|
||||||
|
/// [`color`]: Self::color
|
||||||
pub struct ColorStop {
|
pub struct ColorStop {
|
||||||
/// Offset along the gradient vector.
|
/// Offset along the gradient vector.
|
||||||
pub offset: f32,
|
pub offset: f32,
|
||||||
|
|
||||||
/// The color of the gradient at the specified [`offset`].
|
/// The color of the gradient at the specified [`offset`].
|
||||||
|
///
|
||||||
|
/// [`offset`]: Self::offset
|
||||||
pub color: Color,
|
pub color: Color,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,10 @@
|
||||||
use crate::gradient::{ColorStop, Gradient, Position};
|
use crate::gradient::{ColorStop, Gradient, Position};
|
||||||
use crate::{Color, Point};
|
use crate::{Color, Point};
|
||||||
|
|
||||||
/// A linear gradient that can be used in the style of [`super::Fill`] or [`super::Stroke`].
|
/// A linear gradient that can be used in the style of [`Fill`] or [`Stroke`].
|
||||||
|
///
|
||||||
|
/// [`Fill`]: crate::widget::canvas::Fill
|
||||||
|
/// [`Stroke`]: crate::widget::canvas::Stroke
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct Linear {
|
pub struct Linear {
|
||||||
/// The point where the linear gradient begins.
|
/// The point where the linear gradient begins.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ pub use crate::triangle::Style;
|
||||||
pub struct Fill {
|
pub struct Fill {
|
||||||
/// The color or gradient of the fill.
|
/// The color or gradient of the fill.
|
||||||
///
|
///
|
||||||
/// By default, it is set to [`FillStyle::Solid`] `BLACK`.
|
/// By default, it is set to [`Style::Solid`] with [`Color::BLACK`].
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
|
|
||||||
/// The fill rule defines how to determine what is inside and what is
|
/// The fill rule defines how to determine what is inside and what is
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use iced_native::Color;
|
||||||
pub struct Stroke<'a> {
|
pub struct Stroke<'a> {
|
||||||
/// The color or gradient of the stroke.
|
/// The color or gradient of the stroke.
|
||||||
///
|
///
|
||||||
/// By default, it is set to [`StrokeStyle::Solid`] `BLACK`.
|
/// By default, it is set to a [`Style::Solid`] with [`Color::BLACK`].
|
||||||
pub style: Style,
|
pub style: Style,
|
||||||
/// The distance between the two edges of the stroke.
|
/// The distance between the two edges of the stroke.
|
||||||
pub width: f32,
|
pub width: f32,
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ pub trait Compositor: Sized {
|
||||||
height: u32,
|
height: u32,
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Returns [`GraphicsInformation`] used by this [`Compositor`].
|
/// Returns [`Information`] used by this [`Compositor`].
|
||||||
fn fetch_information(&self) -> Information;
|
fn fetch_information(&self) -> Information;
|
||||||
|
|
||||||
/// Presents the [`Renderer`] primitives to the next frame of the given [`Surface`].
|
/// Presents the [`Renderer`] primitives to the next frame of the given [`Surface`].
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ pub trait GLCompositor: Sized {
|
||||||
/// Resizes the viewport of the [`GLCompositor`].
|
/// Resizes the viewport of the [`GLCompositor`].
|
||||||
fn resize_viewport(&mut self, physical_size: Size<u32>);
|
fn resize_viewport(&mut self, physical_size: Size<u32>);
|
||||||
|
|
||||||
/// Returns [`GraphicsInformation`] used by this [`Compositor`].
|
/// Returns [`Information`] used by this [`GLCompositor`].
|
||||||
fn fetch_information(&self) -> Information;
|
fn fetch_information(&self) -> Information;
|
||||||
|
|
||||||
/// Presents the primitives of the [`Renderer`] to the next frame of the
|
/// Presents the primitives of the [`Renderer`] to the next frame of the
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use crate::layout;
|
||||||
use crate::mouse;
|
use crate::mouse;
|
||||||
use crate::renderer;
|
use crate::renderer;
|
||||||
use crate::widget;
|
use crate::widget;
|
||||||
use crate::widget::tree::{self, Tree};
|
use crate::widget::Tree;
|
||||||
use crate::{Clipboard, Layout, Point, Rectangle, Shell, Size};
|
use crate::{Clipboard, Layout, Point, Rectangle, Shell, Size};
|
||||||
|
|
||||||
/// An interactive component that can be displayed on top of other widgets.
|
/// An interactive component that can be displayed on top of other widgets.
|
||||||
|
|
@ -42,29 +42,7 @@ where
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Returns the [`Tag`] of the [`Widget`].
|
/// Applies a [`widget::Operation`] to the [`Overlay`].
|
||||||
///
|
|
||||||
/// [`Tag`]: tree::Tag
|
|
||||||
fn tag(&self) -> tree::Tag {
|
|
||||||
tree::Tag::stateless()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the [`State`] of the [`Widget`].
|
|
||||||
///
|
|
||||||
/// [`State`]: tree::State
|
|
||||||
fn state(&self) -> tree::State {
|
|
||||||
tree::State::None
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the state [`Tree`] of the children of the [`Widget`].
|
|
||||||
fn children(&self) -> Vec<Tree> {
|
|
||||||
Vec::new()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Reconciliates the [`Widget`] with the provided [`Tree`].
|
|
||||||
fn diff(&self, _tree: &mut Tree) {}
|
|
||||||
|
|
||||||
/// Applies an [`Operation`] to the [`Widget`].
|
|
||||||
fn operate(
|
fn operate(
|
||||||
&self,
|
&self,
|
||||||
_layout: Layout<'_>,
|
_layout: Layout<'_>,
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ where
|
||||||
.draw(renderer, theme, style, layout, cursor_position)
|
.draw(renderer, theme, style, layout, cursor_position)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Applies an [`Operation`] to the [`Element`].
|
/// Applies a [`widget::Operation`] to the [`Element`].
|
||||||
pub fn operate(
|
pub fn operate(
|
||||||
&self,
|
&self,
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use crate::text::{self, Text};
|
||||||
use crate::touch;
|
use crate::touch;
|
||||||
use crate::widget::container::{self, Container};
|
use crate::widget::container::{self, Container};
|
||||||
use crate::widget::scrollable::{self, Scrollable};
|
use crate::widget::scrollable::{self, Scrollable};
|
||||||
use crate::widget::tree::{self, Tree};
|
use crate::widget::Tree;
|
||||||
use crate::{
|
use crate::{
|
||||||
Clipboard, Color, Element, Layout, Length, Padding, Point, Rectangle,
|
Clipboard, Color, Element, Layout, Length, Padding, Point, Rectangle,
|
||||||
Shell, Size, Vector, Widget,
|
Shell, Size, Vector, Widget,
|
||||||
|
|
@ -199,18 +199,6 @@ where
|
||||||
Renderer: text::Renderer,
|
Renderer: text::Renderer,
|
||||||
Renderer::Theme: StyleSheet + container::StyleSheet,
|
Renderer::Theme: StyleSheet + container::StyleSheet,
|
||||||
{
|
{
|
||||||
fn tag(&self) -> tree::Tag {
|
|
||||||
self.container.tag()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn state(&self) -> tree::State {
|
|
||||||
self.container.state()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn children(&self) -> Vec<Tree> {
|
|
||||||
self.container.children()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn layout(
|
fn layout(
|
||||||
&self,
|
&self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ pub fn layout<Renderer>(
|
||||||
layout::Node::with_children(size.pad(padding), vec![content])
|
layout::Node::with_children(size.pad(padding), vec![content])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws the background of a [`Container`] given its [`Style`] and its `bounds`.
|
/// Draws the background of a [`Container`] given its [`Appearance`] and its `bounds`.
|
||||||
pub fn draw_background<Renderer>(
|
pub fn draw_background<Renderer>(
|
||||||
renderer: &mut Renderer,
|
renderer: &mut Renderer,
|
||||||
appearance: &Appearance,
|
appearance: &Appearance,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ macro_rules! column {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a [Row`] with the given children.
|
/// Creates a [`Row`] with the given children.
|
||||||
///
|
///
|
||||||
/// [`Row`]: widget::Row
|
/// [`Row`]: widget::Row
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ where
|
||||||
|
|
||||||
/// Draws the [`Content`] with the provided [`Renderer`] and [`Layout`].
|
/// Draws the [`Content`] with the provided [`Renderer`] and [`Layout`].
|
||||||
///
|
///
|
||||||
/// [`Renderer`]: iced_native::Renderer
|
/// [`Renderer`]: crate::Renderer
|
||||||
pub fn draw(
|
pub fn draw(
|
||||||
&self,
|
&self,
|
||||||
tree: &Tree,
|
tree: &Tree,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ pub struct State<T> {
|
||||||
/// [`PaneGrid`]: crate::widget::PaneGrid
|
/// [`PaneGrid`]: crate::widget::PaneGrid
|
||||||
pub internal: Internal,
|
pub internal: Internal,
|
||||||
|
|
||||||
/// The maximized [`Pane`] of the [`PaneGrid`]
|
/// The maximized [`Pane`] of the [`PaneGrid`].
|
||||||
|
///
|
||||||
|
/// [`PaneGrid`]: crate::widget::PaneGrid
|
||||||
pub(super) maximized: Option<Pane>,
|
pub(super) maximized: Option<Pane>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ where
|
||||||
|
|
||||||
/// Draws the [`TitleBar`] with the provided [`Renderer`] and [`Layout`].
|
/// Draws the [`TitleBar`] with the provided [`Renderer`] and [`Layout`].
|
||||||
///
|
///
|
||||||
/// [`Renderer`]: iced_native::Renderer
|
/// [`Renderer`]: crate::Renderer
|
||||||
pub fn draw(
|
pub fn draw(
|
||||||
&self,
|
&self,
|
||||||
tree: &Tree,
|
tree: &Tree,
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ where
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the [`Color`] of the [`Text`].
|
/// Sets the style of the [`Text`].
|
||||||
pub fn style(
|
pub fn style(
|
||||||
mut self,
|
mut self,
|
||||||
style: impl Into<<Renderer::Theme as StyleSheet>::Style>,
|
style: impl Into<<Renderer::Theme as StyleSheet>::Style>,
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws the [`TextInput`] with the given [`Renderer`], overriding its
|
/// Draws the [`TextInput`] with the given [`Renderer`], overriding its
|
||||||
/// [`text_input::Value`] if provided.
|
/// [`Value`] if provided.
|
||||||
///
|
///
|
||||||
/// [`Renderer`]: text::Renderer
|
/// [`Renderer`]: text::Renderer
|
||||||
pub fn draw(
|
pub fn draw(
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ impl Tree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new [`Tree`] for the provided [`Element`].
|
/// Creates a new [`Tree`] for the provided [`Widget`].
|
||||||
pub fn new<'a, Message, Renderer>(
|
pub fn new<'a, Message, Renderer>(
|
||||||
widget: impl Borrow<dyn Widget<Message, Renderer> + 'a>,
|
widget: impl Borrow<dyn Widget<Message, Renderer> + 'a>,
|
||||||
) -> Self
|
) -> Self
|
||||||
|
|
@ -46,10 +46,10 @@ impl Tree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reconciliates the current tree with the provided [`Element`].
|
/// Reconciliates the current tree with the provided [`Widget`].
|
||||||
///
|
///
|
||||||
/// If the tag of the [`Element`] matches the tag of the [`Tree`], then the
|
/// If the tag of the [`Widget`] matches the tag of the [`Tree`], then the
|
||||||
/// [`Element`] proceeds with the reconciliation (i.e. [`Widget::diff`] is called).
|
/// [`Widget`] proceeds with the reconciliation (i.e. [`Widget::diff`] is called).
|
||||||
///
|
///
|
||||||
/// Otherwise, the whole [`Tree`] is recreated.
|
/// Otherwise, the whole [`Tree`] is recreated.
|
||||||
///
|
///
|
||||||
|
|
@ -67,7 +67,7 @@ impl Tree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reconciliates the children of the tree with the provided list of [`Element`].
|
/// Reconciliates the children of the tree with the provided list of widgets.
|
||||||
pub fn diff_children<'a, Message, Renderer>(
|
pub fn diff_children<'a, Message, Renderer>(
|
||||||
&mut self,
|
&mut self,
|
||||||
new_children: &[impl Borrow<dyn Widget<Message, Renderer> + 'a>],
|
new_children: &[impl Borrow<dyn Widget<Message, Renderer> + 'a>],
|
||||||
|
|
@ -81,7 +81,7 @@ impl Tree {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reconciliates the children of the tree with the provided list of [`Element`] using custom
|
/// Reconciliates the children of the tree with the provided list of widgets using custom
|
||||||
/// logic both for diffing and creating new widget state.
|
/// logic both for diffing and creating new widget state.
|
||||||
pub fn diff_children_custom<T>(
|
pub fn diff_children_custom<T>(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
|
||||||
|
|
@ -148,9 +148,8 @@ pub trait Application: Sized {
|
||||||
Self::Theme::default()
|
Self::Theme::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the current [`Style`] of the [`Theme`].
|
/// Returns the current `Style` of the [`Theme`].
|
||||||
///
|
///
|
||||||
/// [`Style`]: <Self::Theme as StyleSheet>::Style
|
|
||||||
/// [`Theme`]: Self::Theme
|
/// [`Theme`]: Self::Theme
|
||||||
fn style(&self) -> <Self::Theme as StyleSheet>::Style {
|
fn style(&self) -> <Self::Theme as StyleSheet>::Style {
|
||||||
<Self::Theme as StyleSheet>::Style::default()
|
<Self::Theme as StyleSheet>::Style::default()
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
/// A generic [`Overlay`].
|
/// A generic [`Overlay`].
|
||||||
///
|
///
|
||||||
/// This is an alias of an `iced_native` element with a default `Renderer`.
|
/// This is an alias of an `iced_native` element with a default `Renderer`.
|
||||||
|
///
|
||||||
|
/// [`Overlay`]: iced_native::Overlay
|
||||||
pub type Element<'a, Message, Renderer = crate::Renderer> =
|
pub type Element<'a, Message, Renderer = crate::Renderer> =
|
||||||
iced_native::overlay::Element<'a, Message, Renderer>;
|
iced_native::overlay::Element<'a, Message, Renderer>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,10 @@ where
|
||||||
/// title of your application when necessary.
|
/// title of your application when necessary.
|
||||||
fn title(&self) -> String;
|
fn title(&self) -> String;
|
||||||
|
|
||||||
/// Returns the current [`Theme`] of the [`Application`].
|
/// Returns the current `Theme` of the [`Application`].
|
||||||
fn theme(&self) -> <Self::Renderer as crate::Renderer>::Theme;
|
fn theme(&self) -> <Self::Renderer as crate::Renderer>::Theme;
|
||||||
|
|
||||||
/// Returns the [`Style`] variation of the [`Theme`].
|
/// Returns the `Style` variation of the `Theme`.
|
||||||
fn style(
|
fn style(
|
||||||
&self,
|
&self,
|
||||||
) -> <<Self::Renderer as crate::Renderer>::Theme as StyleSheet>::Style {
|
) -> <<Self::Renderer as crate::Renderer>::Theme as StyleSheet>::Style {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue