summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Matthias Vogelgesang <matthias.vogelgesang@gmail.com>2023-09-09 12:24:47 +0200
committerLibravatar Matthias Vogelgesang <matthias.vogelgesang@gmail.com>2023-09-09 18:59:17 +0200
commit89d9f1d7d2202029028a487df1dd11b0665a7517 (patch)
treeff3f998798c9d0b1d334989d941c90b0b1012ee4
parent89d9c45d25e9bf89e48858b135bc7a2d41c757a8 (diff)
downloadiced-89d9f1d7d2202029028a487df1dd11b0665a7517.tar.gz
iced-89d9f1d7d2202029028a487df1dd11b0665a7517.tar.bz2
iced-89d9f1d7d2202029028a487df1dd11b0665a7517.zip
Fix majority of unresolved documentation links
-rw-r--r--core/src/angle.rs2
-rw-r--r--core/src/gradient.rs2
-rw-r--r--core/src/shell.rs4
-rw-r--r--core/src/window/icon.rs2
-rw-r--r--futures/src/runtime.rs5
-rw-r--r--futures/src/subscription.rs6
-rw-r--r--futures/src/subscription/tracker.rs3
-rw-r--r--graphics/src/geometry.rs4
-rw-r--r--graphics/src/gradient.rs4
-rw-r--r--graphics/src/mesh.rs2
-rw-r--r--renderer/src/geometry.rs4
-rw-r--r--renderer/src/settings.rs4
-rw-r--r--runtime/src/lib.rs25
-rw-r--r--runtime/src/overlay/nested.rs4
-rw-r--r--runtime/src/program/state.rs2
-rw-r--r--runtime/src/user_interface.rs4
-rw-r--r--src/lib.rs6
-rw-r--r--src/settings.rs2
-rw-r--r--src/window/icon.rs2
-rw-r--r--wgpu/src/geometry.rs4
-rw-r--r--widget/src/canvas/event.rs2
-rw-r--r--widget/src/canvas/program.rs11
-rw-r--r--widget/src/checkbox.rs6
-rw-r--r--widget/src/combo_box.rs8
-rw-r--r--widget/src/helpers.rs54
-rw-r--r--widget/src/overlay/menu.rs2
-rw-r--r--widget/src/pane_grid/configuration.rs4
-rw-r--r--widget/src/pane_grid/content.rs4
-rw-r--r--widget/src/pane_grid/node.rs2
-rw-r--r--widget/src/pane_grid/pane.rs2
-rw-r--r--widget/src/pane_grid/split.rs2
-rw-r--r--widget/src/pane_grid/state.rs40
-rw-r--r--widget/src/pane_grid/title_bar.rs6
-rw-r--r--widget/src/pick_list.rs2
-rw-r--r--widget/src/radio.rs2
-rw-r--r--widget/src/text_input.rs2
-rw-r--r--widget/src/text_input/value.rs2
-rw-r--r--widget/src/toggler.rs6
-rw-r--r--winit/src/application/state.rs4
-rw-r--r--winit/src/conversion.rs2
40 files changed, 117 insertions, 137 deletions
diff --git a/core/src/angle.rs b/core/src/angle.rs
index c8f3f013..102b69cf 100644
--- a/core/src/angle.rs
+++ b/core/src/angle.rs
@@ -55,7 +55,7 @@ impl num_traits::FromPrimitive for Radians {
}
impl Radians {
- /// Calculates the line in which the [`Angle`] intercepts the `bounds`.
+ /// Calculates the line in which the angle intercepts the `bounds`.
pub fn to_distance(&self, bounds: &Rectangle) -> (Point, Point) {
let angle = self.0 - FRAC_PI_2;
let r = Vector::new(f32::cos(angle), f32::sin(angle));
diff --git a/core/src/gradient.rs b/core/src/gradient.rs
index e19622fb..576c9e4d 100644
--- a/core/src/gradient.rs
+++ b/core/src/gradient.rs
@@ -9,7 +9,7 @@ use std::cmp::Ordering;
///
/// For a gradient which can be used as a fill on a canvas, see [`iced_graphics::Gradient`].
pub enum Gradient {
- /// A linear gradient interpolates colors along a direction at a specific [`Angle`].
+ /// A linear gradient interpolates colors along a direction at a specific angle.
Linear(Linear),
}
diff --git a/core/src/shell.rs b/core/src/shell.rs
index 74a5c616..246c937a 100644
--- a/core/src/shell.rs
+++ b/core/src/shell.rs
@@ -35,7 +35,7 @@ impl<'a, Message> Shell<'a, Message> {
self.messages.push(message);
}
- /// Requests a new frame to be drawn at the given [`Instant`].
+ /// Requests a new frame to be drawn.
pub fn request_redraw(&mut self, request: window::RedrawRequest) {
match self.redraw_request {
None => {
@@ -48,7 +48,7 @@ impl<'a, Message> Shell<'a, Message> {
}
}
- /// Returns the requested [`Instant`] a redraw should happen, if any.
+ /// Returns the request a redraw should happen, if any.
pub fn redraw_request(&self) -> Option<window::RedrawRequest> {
self.redraw_request
}
diff --git a/core/src/window/icon.rs b/core/src/window/icon.rs
index 31868ecf..2fc48e3b 100644
--- a/core/src/window/icon.rs
+++ b/core/src/window/icon.rs
@@ -49,7 +49,7 @@ impl Icon {
}
#[derive(Debug, thiserror::Error)]
-/// An error produced when using [`Icon::from_rgba`] with invalid arguments.
+/// An error produced when using [`from_rgba`] with invalid arguments.
pub enum Error {
/// Produced when the length of the `rgba` argument isn't divisible by 4, thus `rgba` can't be
/// safely interpreted as 32bpp RGBA pixels.
diff --git a/futures/src/runtime.rs b/futures/src/runtime.rs
index 2241a494..16111b36 100644
--- a/futures/src/runtime.rs
+++ b/futures/src/runtime.rs
@@ -9,9 +9,9 @@ use std::marker::PhantomData;
/// A batteries-included runtime of commands and subscriptions.
///
/// If you have an [`Executor`], a [`Runtime`] can be leveraged to run any
-/// [`Command`] or [`Subscription`] and get notified of the results!
+/// `Command` or [`Subscription`] and get notified of the results!
///
-/// [`Command`]: crate::Command
+/// [`Subscription`]: crate::Subscription
#[derive(Debug)]
pub struct Runtime<Executor, Sender, Message> {
executor: Executor,
@@ -75,6 +75,7 @@ where
/// [`Tracker::update`] to learn more about this!
///
/// [`Tracker::update`]: subscription::Tracker::update
+ /// [`Subscription`]: crate::Subscription
pub fn track(
&mut self,
recipes: impl IntoIterator<
diff --git a/futures/src/subscription.rs b/futures/src/subscription.rs
index 759dd223..d40125e3 100644
--- a/futures/src/subscription.rs
+++ b/futures/src/subscription.rs
@@ -19,16 +19,14 @@ pub type EventStream = BoxStream<(Event, event::Status)>;
/// A request to listen to external events.
///
-/// Besides performing async actions on demand with [`Command`], most
+/// Besides performing async actions on demand with `Command`, most
/// applications also need to listen to external events passively.
///
-/// A [`Subscription`] is normally provided to some runtime, like a [`Command`],
+/// A [`Subscription`] is normally provided to some runtime, like a `Command`,
/// and it will generate events as long as the user keeps requesting it.
///
/// For instance, you can use a [`Subscription`] to listen to a WebSocket
/// connection, keyboard presses, mouse events, time ticks, etc.
-///
-/// [`Command`]: crate::Command
#[must_use = "`Subscription` must be returned to runtime to take effect"]
pub struct Subscription<Message> {
recipes: Vec<Box<dyn Recipe<Output = Message>>>,
diff --git a/futures/src/subscription/tracker.rs b/futures/src/subscription/tracker.rs
index ae71cd25..3a83da09 100644
--- a/futures/src/subscription/tracker.rs
+++ b/futures/src/subscription/tracker.rs
@@ -14,6 +14,8 @@ use std::hash::Hasher as _;
/// If you have an application that continuously returns a [`Subscription`],
/// you can use a [`Tracker`] to keep track of the different recipes and keep
/// its executions alive.
+///
+/// [`Subscription`]: crate::Subscription
#[derive(Debug, Default)]
pub struct Tracker {
subscriptions: HashMap<u64, Execution>,
@@ -51,6 +53,7 @@ impl Tracker {
/// the [`Tracker`] changes.
///
/// [`Recipe`]: crate::subscription::Recipe
+ /// [`Subscription`]: crate::Subscription
pub fn update<Message, Receiver>(
&mut self,
recipes: impl Iterator<Item = Box<dyn Recipe<Output = Message>>>,
diff --git a/graphics/src/geometry.rs b/graphics/src/geometry.rs
index 7cd3dd3a..d7d6a0aa 100644
--- a/graphics/src/geometry.rs
+++ b/graphics/src/geometry.rs
@@ -14,11 +14,11 @@ pub use text::Text;
pub use crate::gradient::{self, Gradient};
-/// A renderer capable of drawing some [`Geometry`].
+/// A renderer capable of drawing some [`Self::Geometry`].
pub trait Renderer: crate::core::Renderer {
/// The kind of geometry this renderer can draw.
type Geometry;
- /// Draws the given layers of [`Geometry`].
+ /// Draws the given layers of [`Self::Geometry`].
fn draw(&mut self, layers: Vec<Self::Geometry>);
}
diff --git a/graphics/src/gradient.rs b/graphics/src/gradient.rs
index 4db565d8..f5f5f8b4 100644
--- a/graphics/src/gradient.rs
+++ b/graphics/src/gradient.rs
@@ -1,4 +1,4 @@
-//! A gradient that can be used as a [`Fill`] for some geometry.
+//! A gradient that can be used as a fill for some geometry.
//!
//! For a gradient that you can use as a background variant for a widget, see [`Gradient`].
//!
@@ -53,7 +53,7 @@ pub struct Linear {
}
impl Linear {
- /// Creates a new [`Builder`].
+ /// Creates a new [`Linear`] builder.
pub fn new(start: Point, end: Point) -> Self {
Self {
start,
diff --git a/graphics/src/mesh.rs b/graphics/src/mesh.rs
index cfb5a60f..041986cf 100644
--- a/graphics/src/mesh.rs
+++ b/graphics/src/mesh.rs
@@ -41,7 +41,7 @@ impl Damage for Mesh {
}
}
-/// A set of [`Vertex2D`] and indices representing a list of triangles.
+/// A set of vertices and indices representing a list of triangles.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Indexed<T> {
/// The vertices of the mesh
diff --git a/renderer/src/geometry.rs b/renderer/src/geometry.rs
index 1a974b7f..1ecb0a43 100644
--- a/renderer/src/geometry.rs
+++ b/renderer/src/geometry.rs
@@ -96,13 +96,11 @@ impl Frame {
/// resulting glyphs will not be rotated or scaled properly.
///
/// Additionally, all text will be rendered on top of all the layers of
- /// a [`Canvas`]. Therefore, it is currently only meant to be used for
+ /// a `Canvas`. Therefore, it is currently only meant to be used for
/// overlays, which is the most common use case.
///
/// Support for vectorial text is planned, and should address all these
/// limitations.
- ///
- /// [`Canvas`]: crate::widget::Canvas
pub fn fill_text(&mut self, text: impl Into<Text>) {
delegate!(self, frame, frame.fill_text(text));
}
diff --git a/renderer/src/settings.rs b/renderer/src/settings.rs
index 2e51f339..318ae718 100644
--- a/renderer/src/settings.rs
+++ b/renderer/src/settings.rs
@@ -1,9 +1,7 @@
use crate::core::Font;
use crate::graphics::Antialiasing;
-/// The settings of a [`Backend`].
-///
-/// [`Backend`]: crate::Backend
+/// The settings of a Backend.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Settings {
/// The default [`Font`] to use.
diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs
index 59c70ff7..dc631d47 100644
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -2,32 +2,9 @@
//!
//! ![The native path of the Iced ecosystem](https://github.com/iced-rs/iced/raw/improvement/update-ecosystem-and-roadmap/docs/graphs/native.png)
//!
-//! `iced_native` takes [`iced_core`] and builds a native runtime on top of it,
-//! featuring:
-//!
-//! - A custom layout engine, greatly inspired by [`druid`]
-//! - Event handling for all the built-in widgets
-//! - A renderer-agnostic API
-//!
-//! To achieve this, it introduces a couple of reusable interfaces:
-//!
-//! - A [`Widget`] trait, which is used to implement new widgets: from layout
-//! requirements to event and drawing logic.
-//! - A bunch of `Renderer` traits, meant to keep the crate renderer-agnostic.
-//!
-//! # Usage
-//! The strategy to use this crate depends on your particular use case. If you
-//! want to:
-//! - Implement a custom shell or integrate it in your own system, check out the
-//! [`UserInterface`] type.
-//! - Build a new renderer, see the [renderer] module.
-//! - Build a custom widget, start at the [`Widget`] trait.
+//! `iced_runtime` takes [`iced_core`] and builds a native runtime on top of it.
//!
//! [`iced_core`]: https://github.com/iced-rs/iced/tree/0.10/core
-//! [`iced_winit`]: https://github.com/iced-rs/iced/tree/0.10/winit
-//! [`druid`]: https://github.com/xi-editor/druid
-//! [`raw-window-handle`]: https://github.com/rust-windowing/raw-window-handle
-//! [renderer]: crate::renderer
#![doc(
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
)]
diff --git a/runtime/src/overlay/nested.rs b/runtime/src/overlay/nested.rs
index b729f769..21b6f7c1 100644
--- a/runtime/src/overlay/nested.rs
+++ b/runtime/src/overlay/nested.rs
@@ -6,7 +6,7 @@ use crate::core::renderer;
use crate::core::widget;
use crate::core::{Clipboard, Event, Layout, Point, Rectangle, Shell, Size};
-/// An [`Overlay`] container that displays nested overlays
+/// An overlay container that displays nested overlays
#[allow(missing_debug_implementations)]
pub struct Nested<'a, Message, Renderer> {
overlay: overlay::Element<'a, Message, Renderer>,
@@ -27,6 +27,8 @@ where
}
/// Returns the layout [`Node`] of the [`Nested`] overlay.
+ ///
+ /// [`Node`]: layout::Node
pub fn layout(
&mut self,
renderer: &Renderer,
diff --git a/runtime/src/program/state.rs b/runtime/src/program/state.rs
index 35df6078..9aa2d550 100644
--- a/runtime/src/program/state.rs
+++ b/runtime/src/program/state.rs
@@ -175,7 +175,7 @@ where
(uncaptured_events, command)
}
- /// Applies [`widget::Operation`]s to the [`State`]
+ /// Applies [`Operation`]s to the [`State`]
pub fn operate(
&mut self,
renderer: &mut P::Renderer,
diff --git a/runtime/src/user_interface.rs b/runtime/src/user_interface.rs
index e529c004..165a85ae 100644
--- a/runtime/src/user_interface.rs
+++ b/runtime/src/user_interface.rs
@@ -356,7 +356,7 @@ where
/// It returns the current [`mouse::Interaction`]. You should update the
/// icon of the mouse cursor accordingly in your system.
///
- /// [`Renderer`]: crate::Renderer
+ /// [`Renderer`]: crate::core::Renderer
///
/// # Example
/// We can finally draw our [counter](index.html#usage) by
@@ -619,7 +619,7 @@ pub enum State {
/// The [`UserInterface`] is up-to-date and can be reused without
/// rebuilding.
Updated {
- /// The [`Instant`] when a redraw should be performed.
+ /// The [`window::RedrawRequest`] when a redraw should be performed.
redraw_request: Option<window::RedrawRequest>,
},
}
diff --git a/src/lib.rs b/src/lib.rs
index 91c78423..8780d276 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -258,11 +258,11 @@ pub mod system {
pub mod overlay {
//! Display interactive elements on top of other widgets.
- /// 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 [`overlay::Element`] with a default `Renderer`.
///
- /// [`Overlay`]: iced_native::Overlay
+ /// [`overlay::Element`]: crate::core::overlay::Element
pub type Element<'a, Message, Renderer = crate::Renderer> =
crate::core::overlay::Element<'a, Message, Renderer>;
diff --git a/src/settings.rs b/src/settings.rs
index 0dd46584..8659603c 100644
--- a/src/settings.rs
+++ b/src/settings.rs
@@ -23,7 +23,7 @@ pub struct Settings<Flags> {
/// The default [`Font`] to be used.
///
- /// By default, it uses [`Font::SansSerif`].
+ /// By default, it uses [`Family::SansSerif`](crate::font::Family::SansSerif).
pub default_font: Font,
/// The text size that will be used by default.
diff --git a/src/window/icon.rs b/src/window/icon.rs
index 0cb206b3..ef71c228 100644
--- a/src/window/icon.rs
+++ b/src/window/icon.rs
@@ -10,7 +10,7 @@ use std::path::Path;
/// Creates an icon from an image file.
///
-/// This will return an error in case the file is missing at run-time. You may prefer [`Self::from_file_data`] instead.
+/// This will return an error in case the file is missing at run-time. You may prefer [`from_file_data`] instead.
#[cfg(feature = "image")]
pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> {
let icon = image::io::Reader::open(icon_path)?.decode()?.to_rgba8();
diff --git a/wgpu/src/geometry.rs b/wgpu/src/geometry.rs
index c3e16f8c..63a59c05 100644
--- a/wgpu/src/geometry.rs
+++ b/wgpu/src/geometry.rs
@@ -310,13 +310,11 @@ impl Frame {
/// resulting glyphs will not be rotated or scaled properly.
///
/// Additionally, all text will be rendered on top of all the layers of
- /// a [`Canvas`]. Therefore, it is currently only meant to be used for
+ /// a `Canvas`. Therefore, it is currently only meant to be used for
/// overlays, which is the most common use case.
///
/// Support for vectorial text is planned, and should address all these
/// limitations.
- ///
- /// [`Canvas`]: crate::widget::Canvas
pub fn fill_text(&mut self, text: impl Into<Text>) {
let text = text.into();
diff --git a/widget/src/canvas/event.rs b/widget/src/canvas/event.rs
index 4508c184..1288365f 100644
--- a/widget/src/canvas/event.rs
+++ b/widget/src/canvas/event.rs
@@ -7,7 +7,7 @@ pub use crate::core::event::Status;
/// A [`Canvas`] event.
///
-/// [`Canvas`]: crate::widget::Canvas
+/// [`Canvas`]: crate::Canvas
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Event {
/// A mouse event.
diff --git a/widget/src/canvas/program.rs b/widget/src/canvas/program.rs
index b3f6175e..2ac23061 100644
--- a/widget/src/canvas/program.rs
+++ b/widget/src/canvas/program.rs
@@ -8,7 +8,7 @@ use crate::graphics::geometry;
/// A [`Program`] can mutate internal state and produce messages for an
/// application.
///
-/// [`Canvas`]: crate::widget::Canvas
+/// [`Canvas`]: crate::Canvas
pub trait Program<Message, Renderer = crate::Renderer>
where
Renderer: geometry::Renderer,
@@ -26,7 +26,7 @@ where
///
/// By default, this method does and returns nothing.
///
- /// [`Canvas`]: crate::widget::Canvas
+ /// [`Canvas`]: crate::Canvas
fn update(
&self,
_state: &mut Self::State,
@@ -42,8 +42,9 @@ where
/// [`Geometry`] can be easily generated with a [`Frame`] or stored in a
/// [`Cache`].
///
- /// [`Frame`]: crate::widget::canvas::Frame
- /// [`Cache`]: crate::widget::canvas::Cache
+ /// [`Geometry`]: crate::canvas::Geometry
+ /// [`Frame`]: crate::canvas::Frame
+ /// [`Cache`]: crate::canvas::Cache
fn draw(
&self,
state: &Self::State,
@@ -58,7 +59,7 @@ where
/// The interaction returned will be in effect even if the cursor position
/// is out of bounds of the program's [`Canvas`].
///
- /// [`Canvas`]: crate::widget::Canvas
+ /// [`Canvas`]: crate::Canvas
fn mouse_interaction(
&self,
_state: &Self::State,
diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs
index 310a67ed..e574c3cc 100644
--- a/widget/src/checkbox.rs
+++ b/widget/src/checkbox.rs
@@ -122,7 +122,7 @@ where
self
}
- /// Sets the text [`LineHeight`] of the [`Checkbox`].
+ /// Sets the text [`text::LineHeight`] of the [`Checkbox`].
pub fn text_line_height(
mut self,
line_height: impl Into<text::LineHeight>,
@@ -137,9 +137,9 @@ where
self
}
- /// Sets the [`Font`] of the text of the [`Checkbox`].
+ /// Sets the [`Renderer::Font`] of the text of the [`Checkbox`].
///
- /// [`Font`]: crate::text::Renderer::Font
+ /// [`Renderer::Font`]: crate::core::text::Renderer
pub fn font(mut self, font: impl Into<Renderer::Font>) -> Self {
self.font = Some(font.into());
self
diff --git a/widget/src/combo_box.rs b/widget/src/combo_box.rs
index 690ef27c..0dc12354 100644
--- a/widget/src/combo_box.rs
+++ b/widget/src/combo_box.rs
@@ -20,7 +20,7 @@ use std::time::Instant;
///
/// This widget is composed by a [`TextInput`] that can be filled with the text
/// to search for corresponding values from the list of options that are displayed
-/// as a [`Menu`].
+/// as a Menu.
#[allow(missing_debug_implementations)]
pub struct ComboBox<'a, T, Message, Renderer = crate::Renderer>
where
@@ -131,14 +131,16 @@ where
self
}
- /// Sets the [`Font`] of the [`ComboBox`].
+ /// Sets the [`Renderer::Font`] of the [`ComboBox`].
+ ///
+ /// [`Renderer::Font`]: text::Renderer
pub fn font(mut self, font: Renderer::Font) -> Self {
self.text_input = self.text_input.font(font);
self.font = Some(font);
self
}
- /// Sets the [`Icon`] of the [`ComboBox`].
+ /// Sets the [`text_input::Icon`] of the [`ComboBox`].
pub fn icon(mut self, icon: text_input::Icon<Renderer::Font>) -> Self {
self.text_input = self.text_input.icon(icon);
self
diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs
index 9c3c83a9..289720eb 100644
--- a/widget/src/helpers.rs
+++ b/widget/src/helpers.rs
@@ -25,7 +25,7 @@ use std::ops::RangeInclusive;
/// Creates a [`Column`] with the given children.
///
-/// [`Column`]: widget::Column
+/// [`Column`]: crate::Column
#[macro_export]
macro_rules! column {
() => (
@@ -38,7 +38,7 @@ macro_rules! column {
/// Creates a [`Row`] with the given children.
///
-/// [`Row`]: widget::Row
+/// [`Row`]: crate::Row
#[macro_export]
macro_rules! row {
() => (
@@ -51,7 +51,7 @@ macro_rules! row {
/// Creates a new [`Container`] with the provided content.
///
-/// [`Container`]: widget::Container
+/// [`Container`]: crate::Container
pub fn container<'a, Message, Renderer>(
content: impl Into<Element<'a, Message, Renderer>>,
) -> Container<'a, Message, Renderer>
@@ -64,7 +64,7 @@ where
/// Creates a new [`Column`] with the given children.
///
-/// [`Column`]: widget::Column
+/// [`Column`]: crate::Column
pub fn column<Message, Renderer>(
children: Vec<Element<'_, Message, Renderer>>,
) -> Column<'_, Message, Renderer> {
@@ -73,7 +73,7 @@ pub fn column<Message, Renderer>(
/// Creates a new [`Row`] with the given children.
///
-/// [`Row`]: widget::Row
+/// [`Row`]: crate::Row
pub fn row<Message, Renderer>(
children: Vec<Element<'_, Message, Renderer>>,
) -> Row<'_, Message, Renderer> {
@@ -82,7 +82,7 @@ pub fn row<Message, Renderer>(
/// Creates a new [`Scrollable`] with the provided content.
///
-/// [`Scrollable`]: widget::Scrollable
+/// [`Scrollable`]: crate::Scrollable
pub fn scrollable<'a, Message, Renderer>(
content: impl Into<Element<'a, Message, Renderer>>,
) -> Scrollable<'a, Message, Renderer>
@@ -95,7 +95,7 @@ where
/// Creates a new [`Button`] with the provided content.
///
-/// [`Button`]: widget::Button
+/// [`Button`]: crate::Button
pub fn button<'a, Message, Renderer>(
content: impl Into<Element<'a, Message, Renderer>>,
) -> Button<'a, Message, Renderer>
@@ -109,8 +109,8 @@ where
/// Creates a new [`Tooltip`] with the provided content, tooltip text, and [`tooltip::Position`].
///
-/// [`Tooltip`]: widget::Tooltip
-/// [`tooltip::Position`]: widget::tooltip::Position
+/// [`Tooltip`]: crate::Tooltip
+/// [`tooltip::Position`]: crate::tooltip::Position
pub fn tooltip<'a, Message, Renderer>(
content: impl Into<Element<'a, Message, Renderer>>,
tooltip: impl ToString,
@@ -125,7 +125,7 @@ where
/// Creates a new [`Text`] widget with the provided content.
///
-/// [`Text`]: widget::Text
+/// [`Text`]: core::widget::Text
pub fn text<'a, Renderer>(text: impl ToString) -> Text<'a, Renderer>
where
Renderer: core::text::Renderer,
@@ -136,7 +136,7 @@ where
/// Creates a new [`Checkbox`].
///
-/// [`Checkbox`]: widget::Checkbox
+/// [`Checkbox`]: crate::Checkbox
pub fn checkbox<'a, Message, Renderer>(
label: impl Into<String>,
is_checked: bool,
@@ -151,7 +151,7 @@ where
/// Creates a new [`Radio`].
///
-/// [`Radio`]: widget::Radio
+/// [`Radio`]: crate::Radio
pub fn radio<Message, Renderer, V>(
label: impl Into<String>,
value: V,
@@ -169,7 +169,7 @@ where
/// Creates a new [`Toggler`].
///
-/// [`Toggler`]: widget::Toggler
+/// [`Toggler`]: crate::Toggler
pub fn toggler<'a, Message, Renderer>(
label: impl Into<Option<String>>,
is_checked: bool,
@@ -184,7 +184,7 @@ where
/// Creates a new [`TextInput`].
///
-/// [`TextInput`]: widget::TextInput
+/// [`TextInput`]: crate::TextInput
pub fn text_input<'a, Message, Renderer>(
placeholder: &str,
value: &str,
@@ -199,7 +199,7 @@ where
/// Creates a new [`Slider`].
///
-/// [`Slider`]: widget::Slider
+/// [`Slider`]: crate::Slider
pub fn slider<'a, T, Message, Renderer>(
range: std::ops::RangeInclusive<T>,
value: T,
@@ -216,7 +216,7 @@ where
/// Creates a new [`VerticalSlider`].
///
-/// [`VerticalSlider`]: widget::VerticalSlider
+/// [`VerticalSlider`]: crate::VerticalSlider
pub fn vertical_slider<'a, T, Message, Renderer>(
range: std::ops::RangeInclusive<T>,
value: T,
@@ -233,7 +233,7 @@ where
/// Creates a new [`PickList`].
///
-/// [`PickList`]: widget::PickList
+/// [`PickList`]: crate::PickList
pub fn pick_list<'a, Message, Renderer, T>(
options: impl Into<Cow<'a, [T]>>,
selected: Option<T>,
@@ -255,7 +255,7 @@ where
/// Creates a new [`ComboBox`].
///
-/// [`ComboBox`]: widget::ComboBox
+/// [`ComboBox`]: crate::ComboBox
pub fn combo_box<'a, T, Message, Renderer>(
state: &'a combo_box::State<T>,
placeholder: &str,
@@ -272,21 +272,21 @@ where
/// Creates a new horizontal [`Space`] with the given [`Length`].
///
-/// [`Space`]: widget::Space
+/// [`Space`]: crate::Space
pub fn horizontal_space(width: impl Into<Length>) -> Space {
Space::with_width(width)
}
/// Creates a new vertical [`Space`] with the given [`Length`].
///
-/// [`Space`]: widget::Space
+/// [`Space`]: crate::Space
pub fn vertical_space(height: impl Into<Length>) -> Space {
Space::with_height(height)
}
/// Creates a horizontal [`Rule`] with the given height.
///
-/// [`Rule`]: widget::Rule
+/// [`Rule`]: crate::Rule
pub fn horizontal_rule<Renderer>(height: impl Into<Pixels>) -> Rule<Renderer>
where
Renderer: core::Renderer,
@@ -297,7 +297,7 @@ where
/// Creates a vertical [`Rule`] with the given width.
///
-/// [`Rule`]: widget::Rule
+/// [`Rule`]: crate::Rule
pub fn vertical_rule<Renderer>(width: impl Into<Pixels>) -> Rule<Renderer>
where
Renderer: core::Renderer,
@@ -312,7 +312,7 @@ where
/// * an inclusive range of possible values, and
/// * the current value of the [`ProgressBar`].
///
-/// [`ProgressBar`]: widget::ProgressBar
+/// [`ProgressBar`]: crate::ProgressBar
pub fn progress_bar<Renderer>(
range: RangeInclusive<f32>,
value: f32,
@@ -326,7 +326,7 @@ where
/// Creates a new [`Image`].
///
-/// [`Image`]: widget::Image
+/// [`Image`]: crate::Image
#[cfg(feature = "image")]
pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> {
crate::Image::new(handle.into())
@@ -334,8 +334,8 @@ pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> {
/// Creates a new [`Svg`] widget from the given [`Handle`].
///
-/// [`Svg`]: widget::Svg
-/// [`Handle`]: widget::svg::Handle
+/// [`Svg`]: crate::Svg
+/// [`Handle`]: crate::svg::Handle
#[cfg(feature = "svg")]
pub fn svg<Renderer>(
handle: impl Into<core::svg::Handle>,
@@ -348,6 +348,8 @@ where
}
/// Creates a new [`Canvas`].
+///
+/// [`Canvas`]: crate::Canvas
#[cfg(feature = "canvas")]
pub fn canvas<P, Message, Renderer>(
program: P,
diff --git a/widget/src/overlay/menu.rs b/widget/src/overlay/menu.rs
index f7bdeef6..711a8891 100644
--- a/widget/src/overlay/menu.rs
+++ b/widget/src/overlay/menu.rs
@@ -89,7 +89,7 @@ where
self
}
- /// Sets the text [`LineHeight`] of the [`Menu`].
+ /// Sets the text [`text::LineHeight`] of the [`Menu`].
pub fn text_line_height(
mut self,
line_height: impl Into<text::LineHeight>,
diff --git a/widget/src/pane_grid/configuration.rs b/widget/src/pane_grid/configuration.rs
index ddbc3bc2..b8aa2c7d 100644
--- a/widget/src/pane_grid/configuration.rs
+++ b/widget/src/pane_grid/configuration.rs
@@ -2,7 +2,7 @@ use crate::pane_grid::Axis;
/// The arrangement of a [`PaneGrid`].
///
-/// [`PaneGrid`]: crate::widget::PaneGrid
+/// [`PaneGrid`]: super::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::widget::pane_grid::Pane
+ /// [`Pane`]: super::Pane
Pane(T),
}
diff --git a/widget/src/pane_grid/content.rs b/widget/src/pane_grid/content.rs
index e890e41a..218adcd5 100644
--- a/widget/src/pane_grid/content.rs
+++ b/widget/src/pane_grid/content.rs
@@ -10,7 +10,7 @@ use crate::pane_grid::{Draggable, TitleBar};
/// The content of a [`Pane`].
///
-/// [`Pane`]: crate::widget::pane_grid::Pane
+/// [`Pane`]: super::Pane
#[allow(missing_debug_implementations)]
pub struct Content<'a, Message, Renderer = crate::Renderer>
where
@@ -87,7 +87,7 @@ where
/// Draws the [`Content`] with the provided [`Renderer`] and [`Layout`].
///
- /// [`Renderer`]: crate::Renderer
+ /// [`Renderer`]: crate::core::Renderer
pub fn draw(
&self,
tree: &Tree,
diff --git a/widget/src/pane_grid/node.rs b/widget/src/pane_grid/node.rs
index 6de5920f..3c707f15 100644
--- a/widget/src/pane_grid/node.rs
+++ b/widget/src/pane_grid/node.rs
@@ -5,7 +5,7 @@ use std::collections::BTreeMap;
/// A layout node of a [`PaneGrid`].
///
-/// [`PaneGrid`]: crate::widget::PaneGrid
+/// [`PaneGrid`]: super::PaneGrid
#[derive(Debug, Clone)]
pub enum Node {
/// The region of this [`Node`] is split into two.
diff --git a/widget/src/pane_grid/pane.rs b/widget/src/pane_grid/pane.rs
index d6fbab83..cabf55c1 100644
--- a/widget/src/pane_grid/pane.rs
+++ b/widget/src/pane_grid/pane.rs
@@ -1,5 +1,5 @@
/// A rectangular region in a [`PaneGrid`] used to display widgets.
///
-/// [`PaneGrid`]: crate::widget::PaneGrid
+/// [`PaneGrid`]: super::PaneGrid
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Pane(pub(super) usize);
diff --git a/widget/src/pane_grid/split.rs b/widget/src/pane_grid/split.rs
index 8132272a..ce021978 100644
--- a/widget/src/pane_grid/split.rs
+++ b/widget/src/pane_grid/split.rs
@@ -1,5 +1,5 @@
/// A divider that splits a region in a [`PaneGrid`] into two different panes.
///
-/// [`PaneGrid`]: crate::widget::PaneGrid
+/// [`PaneGrid`]: super::PaneGrid
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Split(pub(super) usize);
diff --git a/widget/src/pane_grid/state.rs b/widget/src/pane_grid/state.rs
index 6fd15890..28a52cf0 100644
--- a/widget/src/pane_grid/state.rs
+++ b/widget/src/pane_grid/state.rs
@@ -1,6 +1,6 @@
//! The state of a [`PaneGrid`].
//!
-//! [`PaneGrid`]: crate::widget::PaneGrid
+//! [`PaneGrid`]: super::PaneGrid
use crate::core::{Point, Size};
use crate::pane_grid::{
Axis, Configuration, Direction, Edge, Node, Pane, Region, Split, Target,
@@ -18,23 +18,23 @@ use std::collections::HashMap;
/// provided to the view function of [`PaneGrid::new`] for displaying each
/// [`Pane`].
///
-/// [`PaneGrid`]: crate::widget::PaneGrid
-/// [`PaneGrid::new`]: crate::widget::PaneGrid::new
+/// [`PaneGrid`]: super::PaneGrid
+/// [`PaneGrid::new`]: super::PaneGrid::new
#[derive(Debug, Clone)]
pub struct State<T> {
/// The panes of the [`PaneGrid`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
pub panes: HashMap<Pane, T>,
/// The internal state of the [`PaneGrid`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
pub internal: Internal,
/// The maximized [`Pane`] of the [`PaneGrid`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
pub(super) maximized: Option<Pane>,
}
@@ -236,6 +236,8 @@ impl<T> State<T> {
}
/// Move [`Pane`] to an [`Edge`] of the [`PaneGrid`].
+ ///
+ /// [`PaneGrid`]: super::PaneGrid
pub fn move_to_edge(&mut self, pane: &Pane, edge: Edge) {
match edge {
Edge::Top => {
@@ -269,8 +271,8 @@ impl<T> State<T> {
/// If you want to swap panes on drag and drop in your [`PaneGrid`], you
/// will need to call this method when handling a [`DragEvent`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
- /// [`DragEvent`]: crate::widget::pane_grid::DragEvent
+ /// [`PaneGrid`]: super::PaneGrid
+ /// [`DragEvent`]: super::DragEvent
pub fn swap(&mut self, a: &Pane, b: &Pane) {
self.internal.layout.update(&|node| match node {
Node::Split { .. } => {}
@@ -292,8 +294,8 @@ impl<T> State<T> {
/// If you want to enable resize interactions in your [`PaneGrid`], you will
/// need to call this method when handling a [`ResizeEvent`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
- /// [`ResizeEvent`]: crate::widget::pane_grid::ResizeEvent
+ /// [`PaneGrid`]: super::PaneGrid
+ /// [`ResizeEvent`]: super::ResizeEvent
pub fn resize(&mut self, split: &Split, ratio: f32) {
let _ = self.internal.layout.resize(split, ratio);
}
@@ -315,7 +317,7 @@ impl<T> State<T> {
/// Maximize the given [`Pane`]. Only this pane will be rendered by the
/// [`PaneGrid`] until [`Self::restore()`] is called.
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
pub fn maximize(&mut self, pane: &Pane) {
self.maximized = Some(*pane);
}
@@ -323,14 +325,14 @@ impl<T> State<T> {
/// Restore the currently maximized [`Pane`] to it's normal size. All panes
/// will be rendered by the [`PaneGrid`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
pub fn restore(&mut self) {
let _ = self.maximized.take();
}
/// Returns the maximized [`Pane`] of the [`PaneGrid`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
pub fn maximized(&self) -> Option<Pane> {
self.maximized
}
@@ -338,7 +340,7 @@ impl<T> State<T> {
/// The internal state of a [`PaneGrid`].
///
-/// [`PaneGrid`]: crate::widget::PaneGrid
+/// [`PaneGrid`]: super::PaneGrid
#[derive(Debug, Clone)]
pub struct Internal {
layout: Node,
@@ -349,7 +351,7 @@ impl Internal {
/// Initializes the [`Internal`] state of a [`PaneGrid`] from a
/// [`Configuration`].
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
pub fn from_configuration<T>(
panes: &mut HashMap<Pane, T>,
content: Configuration<T>,
@@ -394,16 +396,16 @@ impl Internal {
/// The current action of a [`PaneGrid`].
///
-/// [`PaneGrid`]: crate::widget::PaneGrid
+/// [`PaneGrid`]: super::PaneGrid
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Action {
/// The [`PaneGrid`] is idle.
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
Idle,
/// A [`Pane`] in the [`PaneGrid`] is being dragged.
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
Dragging {
/// The [`Pane`] being dragged.
pane: Pane,
@@ -412,7 +414,7 @@ pub enum Action {
},
/// A [`Split`] in the [`PaneGrid`] is being dragged.
///
- /// [`PaneGrid`]: crate::widget::PaneGrid
+ /// [`PaneGrid`]: super::PaneGrid
Resizing {
/// The [`Split`] being dragged.
split: Split,
diff --git a/widget/src/pane_grid/title_bar.rs b/widget/src/pane_grid/title_bar.rs
index cac24e68..47457337 100644
--- a/widget/src/pane_grid/title_bar.rs
+++ b/widget/src/pane_grid/title_bar.rs
@@ -11,7 +11,7 @@ use crate::core::{
/// The title bar of a [`Pane`].
///
-/// [`Pane`]: crate::widget::pane_grid::Pane
+/// [`Pane`]: super::Pane
#[allow(missing_debug_implementations)]
pub struct TitleBar<'a, Message, Renderer = crate::Renderer>
where
@@ -75,7 +75,7 @@ where
/// [`TitleBar`] is hovered.
///
/// [`controls`]: Self::controls
- /// [`Pane`]: crate::widget::pane_grid::Pane
+ /// [`Pane`]: super::Pane
pub fn always_show_controls(mut self) -> Self {
self.always_show_controls = true;
self
@@ -114,7 +114,7 @@ where
/// Draws the [`TitleBar`] with the provided [`Renderer`] and [`Layout`].
///
- /// [`Renderer`]: crate::Renderer
+ /// [`Renderer`]: crate::core::Renderer
pub fn draw(
&self,
tree: &Tree,
diff --git a/widget/src/pick_list.rs b/widget/src/pick_list.rs
index 0a1e2a99..26fe5ca2 100644
--- a/widget/src/pick_list.rs
+++ b/widget/src/pick_list.rs
@@ -105,7 +105,7 @@ where
self
}
- /// Sets the text [`LineHeight`] of the [`PickList`].
+ /// Sets the text [`text::LineHeight`] of the [`PickList`].
pub fn text_line_height(
mut self,
line_height: impl Into<text::LineHeight>,
diff --git a/widget/src/radio.rs b/widget/src/radio.rs
index 65d71ec2..12bbd9c7 100644
--- a/widget/src/radio.rs
+++ b/widget/src/radio.rs
@@ -156,7 +156,7 @@ where
self
}
- /// Sets the text [`LineHeight`] of the [`Radio`] button.
+ /// Sets the text [`text::LineHeight`] of the [`Radio`] button.
pub fn text_line_height(
mut self,
line_height: impl Into<text::LineHeight>,
diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs
index 61fc0055..f7a90880 100644
--- a/widget/src/text_input.rs
+++ b/widget/src/text_input.rs
@@ -182,7 +182,7 @@ where
self
}
- /// Sets the [`LineHeight`] of the [`TextInput`].
+ /// Sets the [`text::LineHeight`] of the [`TextInput`].
pub fn line_height(
mut self,
line_height: impl Into<text::LineHeight>,
diff --git a/widget/src/text_input/value.rs b/widget/src/text_input/value.rs
index cf4da562..d1b056c8 100644
--- a/widget/src/text_input/value.rs
+++ b/widget/src/text_input/value.rs
@@ -2,7 +2,7 @@ use unicode_segmentation::UnicodeSegmentation;
/// The value of a [`TextInput`].
///
-/// [`TextInput`]: crate::widget::TextInput
+/// [`TextInput`]: super::TextInput
// TODO: Reduce allocations, cache results (?)
#[derive(Debug, Clone)]
pub struct Value {
diff --git a/widget/src/toggler.rs b/widget/src/toggler.rs
index c8187181..3793f5b0 100644
--- a/widget/src/toggler.rs
+++ b/widget/src/toggler.rs
@@ -109,7 +109,7 @@ where
self
}
- /// Sets the text [`LineHeight`] of the [`Toggler`].
+ /// Sets the text [`text::LineHeight`] of the [`Toggler`].
pub fn text_line_height(
mut self,
line_height: impl Into<text::LineHeight>,
@@ -136,9 +136,9 @@ where
self
}
- /// Sets the [`Font`] of the text of the [`Toggler`]
+ /// Sets the [`Renderer::Font`] of the text of the [`Toggler`]
///
- /// [`Font`]: crate::text::Renderer::Font
+ /// [`Renderer::Font`]: crate::core::text::Renderer
pub fn font(mut self, font: impl Into<Renderer::Font>) -> Self {
self.font = Some(font.into());
self
diff --git a/winit/src/application/state.rs b/winit/src/application/state.rs
index 967f43f2..e655529a 100644
--- a/winit/src/application/state.rs
+++ b/winit/src/application/state.rs
@@ -184,9 +184,7 @@ where
/// window.
///
/// Normally an [`Application`] should be synchronized with its [`State`]
- /// and window after calling [`Application::update`].
- ///
- /// [`Application::update`]: crate::Program::update
+ /// and window after calling [`crate::application::update`].
pub fn synchronize(&mut self, application: &A, window: &Window) {
// Update window title
let new_title = application.title();
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index b2398e62..3ecd044c 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -521,7 +521,7 @@ pub fn user_attention(
}
}
-/// Converts some [`Icon`] into it's `winit` counterpart.
+/// Converts some [`window::Icon`] into it's `winit` counterpart.
///
/// Returns `None` if there is an error during the conversion.
pub fn icon(icon: window::Icon) -> Option<winit::window::Icon> {