chore(doc): add documentation for a handful of widgets

This commit is contained in:
Michael Aaron Murphy 2024-05-20 20:01:47 +02:00
parent 0d4c3db162
commit f4936344f0
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
15 changed files with 113 additions and 10 deletions

View file

@ -11,6 +11,7 @@ use std::borrow::Cow;
pub type Button<'a, Message> = Builder<'a, Message, Image<'a, Handle, Message>>;
/// A button constructed from an image handle, using image button styling.
pub fn image<'a, Message>(handle: impl Into<Handle> + 'a) -> Button<'a, Message> {
Button::new(Image {
image: widget::image(handle).border_radius([9.0; 4]),
@ -19,6 +20,7 @@ pub fn image<'a, Message>(handle: impl Into<Handle> + 'a) -> Button<'a, Message>
})
}
/// The image variant of a button.
pub struct Image<'a, Handle, Message> {
image: widget::Image<'a, Handle>,
selected: bool,