Skip to content

Commit 335c3ff

Browse files
authored
Rustdoc links in bevy_ui (#11555)
# Objective No links between types make create rustdoc harder to understand. ## Solution Add links. Also tweak some sentences.
1 parent bcae8e9 commit 335c3ff

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

crates/bevy_ui/src/focus.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
3333
///
3434
/// Note that you can also control the visibility of a node using the [`Display`](crate::ui_node::Display) property,
3535
/// which fully collapses it during layout calculations.
36+
///
37+
/// # See also
38+
///
39+
/// - [`ButtonBundle`](crate::node_bundles::ButtonBundle) which includes this component
40+
/// - [`RelativeCursorPosition`] to obtain the position of the cursor relative to current node
3641
#[derive(Component, Copy, Clone, Eq, PartialEq, Debug, Reflect)]
3742
#[reflect(Component, Default, PartialEq)]
3843
#[cfg_attr(
@@ -63,9 +68,10 @@ impl Default for Interaction {
6368

6469
/// A component storing the position of the mouse relative to the node, (0., 0.) being the top-left corner and (1., 1.) being the bottom-right
6570
/// If the mouse is not over the node, the value will go beyond the range of (0., 0.) to (1., 1.)
66-
6771
///
68-
/// It can be used alongside interaction to get the position of the press.
72+
/// It can be used alongside [`Interaction`] to get the position of the press.
73+
///
74+
/// The component is updated when it is in the same entity with [`Node`].
6975
#[derive(Component, Copy, Clone, Default, PartialEq, Debug, Reflect)]
7076
#[reflect(Component, Default, PartialEq)]
7177
#[cfg_attr(

crates/bevy_ui/src/node_bundles.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ use bevy_sprite::TextureAtlas;
1818
use bevy_text::{BreakLineOn, JustifyText, Text, TextLayoutInfo, TextSection, TextStyle};
1919
use bevy_transform::prelude::{GlobalTransform, Transform};
2020

21-
/// The basic UI node
21+
/// The basic UI node.
2222
///
23-
/// Useful as a container for a variety of child nodes.
23+
/// Contains the [`Node`] component and other components required to make a container.
24+
///
25+
/// See [`node_bundles`](crate::node_bundles) for more specialized bundles like [`TextBundle`].
2426
#[derive(Bundle, Clone, Debug)]
2527
pub struct NodeBundle {
2628
/// Describes the logical size of the node

crates/bevy_ui/src/ui_node.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ use bevy_window::{PrimaryWindow, WindowRef};
1414
use std::num::{NonZeroI16, NonZeroU16};
1515
use thiserror::Error;
1616

17-
/// Describes the size of a UI node
17+
/// Base component for a UI node, which also provides the computed size of the node.
18+
///
19+
/// # See also
20+
///
21+
/// - [`node_bundles`](crate::node_bundles) for the list of built-in bundles that set up UI node
22+
/// - [`RelativeCursorPosition`](crate::RelativeCursorPosition)
23+
/// to obtain the cursor position relative to this node
24+
/// - [`Interaction`](crate::Interaction) to obtain the interaction state of this node
1825
#[derive(Component, Debug, Copy, Clone, Reflect)]
1926
#[reflect(Component, Default)]
2027
pub struct Node {

0 commit comments

Comments
 (0)