From 85d2a3718efeb52dd21bbc30acee986694cc5070 Mon Sep 17 00:00:00 2001 From: Ben Frankel Date: Tue, 20 Aug 2024 17:12:29 -0700 Subject: [PATCH] Bump to v0.1.1 to fix dumb documentation warnings --- Cargo.toml | 2 +- src/lib.rs | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ff9ed7e..358fbd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyri_tooltip" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "Powerful tooltips for Bevy" repository = "https://github.com/benfrankel/pyri_tooltip" diff --git a/src/lib.rs b/src/lib.rs index 558fd77..6ece9d0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,18 +10,22 @@ //! //! Add [`TooltipPlugin`] to set up the tooltip system: //! -//! ```ignore +//! ``` +//! # /* //! app.add_plugins(TooltipPlugin::default()); +//! # */ //! ``` //! //! Spawn a UI node with [`Interaction`](bevy_ui::Interaction) and [`Tooltip`] components: //! -//! ```ignore +//! ``` +//! # /* //! commands.spawn(( //! NodeBundle::default(), //! Interaction::default(), //! Tooltip::cursor("Hello, world!"), //! )); +//! # */ //! ``` //! //! # Advanced @@ -173,14 +177,9 @@ impl PrimaryTooltip { // TODO: Animation, wedge (like a speech bubble), easier content customization / icons. /// A [`Component`] that specifies a tooltip to be displayed on hover. /// -/// This will only work on entities that also include the following components: -/// - [`NodeBundle`] components +/// This will only work for entities that also include the following: +/// - [`NodeBundle`] /// - [`Interaction`](bevy_ui::Interaction) -/// -/// The default behavior consists of the following values: -/// - [`TooltipActivation::IDLE`] -/// - [`TooltipTransfer::NONE`] -/// - [`TooltipPlacement::CURSOR`] #[derive(Component, Clone, Debug)] #[cfg_attr( feature = "bevy_reflect", @@ -194,7 +193,7 @@ pub struct Tooltip { pub dismissal: TooltipDismissal, /// The conditions for skipping the next tooltip's activation delay. pub transfer: TooltipTransfer, - /// How the position of the tooltip entity should be determined. + /// How the position of the tooltip entity will be determined. pub placement: TooltipPlacement, /// The tooltip entity and content to be displayed. pub content: TooltipContent, @@ -223,7 +222,7 @@ impl Tooltip { } } - /// Set [`JustifyText`]. + /// Change the text justification. /// /// NOTE: This does nothing for custom tooltips. pub fn with_justify(mut self, justify_text: JustifyText) -> Self { @@ -234,25 +233,25 @@ impl Tooltip { self } - /// Set [`TooltipActivation`]. + /// Set a custom [`TooltipActivation`]. pub fn with_activation(mut self, activation: impl Into) -> Self { self.activation = activation.into(); self } - /// Set [`TooltipDismissal`]. + /// Set a custom [`TooltipDismissal`]. pub fn with_dismissal(mut self, dismissal: impl Into) -> Self { self.dismissal = dismissal.into(); self } - /// Set [`TooltipTransfer`]. + /// Set a custom [`TooltipTransfer`]. pub fn with_transfer(mut self, transfer: impl Into) -> Self { self.transfer = transfer.into(); self } - /// Set [`TooltipPlacement`]. + /// Set a custom [`TooltipPlacement`]. pub fn with_placement(mut self, placement: impl Into) -> Self { self.placement = placement.into(); self