diff --git a/widgetry/src/lib.rs b/widgetry/src/lib.rs index f0700f9d97..d8c61c844d 100644 --- a/widgetry/src/lib.rs +++ b/widgetry/src/lib.rs @@ -21,7 +21,7 @@ //! * [`Slider`] - horizontal and vertical sliders //! * [`Spinner`] - numeric input with up/down buttons //! * [`table::Table`] - rows and columns, supporting filtering and pagination -//! * [`TexBox`] - single line text entry +//! * [`TextBox`] - single line text entry //#![warn(missing_docs)] @@ -93,7 +93,9 @@ mod backend { pub use crate::backend_glow::*; } -/// return the name of the included file, along with its bytes. +/// Like [`std::include_bytes!`], but also returns its argument, the relative path to the bytes +/// +/// returns a `(path, bytes): (&str, &[u8])` tuple #[macro_export] macro_rules! include_labeled_bytes { ($file:expr) => { diff --git a/widgetry/src/widgets/button.rs b/widgetry/src/widgets/button.rs index 928d64ec03..a0ba00bbbe 100644 --- a/widgetry/src/widgets/button.rs +++ b/widgetry/src/widgets/button.rs @@ -255,7 +255,7 @@ impl<'b, 'a: 'b> ButtonBuilder<'a> { /// Set the image for the button. If not set, the button will have no image. /// - /// This will replace any image previously set by [`image_bytes`] + /// This will replace any image previously set by [`Self::image_bytes`] pub fn image_path(mut self, path: &'a str) -> Self { // Currently we don't support setting image for other states like "hover", we easily // could, but the API gets more verbose for a thing we don't currently need. @@ -267,10 +267,11 @@ impl<'b, 'a: 'b> ButtonBuilder<'a> { /// Set the image for the button. If not set, the button will have no image. /// - /// This will replace any image previously set by [`image_path`]. - /// - /// `bytes`: utf-8 encoded bytes of the svg - /// `label`: a label to describe the bytes for debugging purposes + /// This will replace any image previously set by [`Self::image_path`]. + /// * `labeled_bytes`: is a (`label`, `bytes`) tuple you can generate with + /// [`include_labeled_bytes!`] + /// * `label`: a label to describe the bytes for debugging purposes + /// * `bytes`: utf-8 encoded bytes of the svg pub fn image_bytes(mut self, labeled_bytes: (&'a str, &'a [u8])) -> Self { let (label, bytes) = labeled_bytes; // Currently we don't support setting image for other states like "hover", we easily