Write doc examples for column and row

This commit is contained in:
Héctor Ramón Jiménez 2024-09-19 06:49:22 +02:00
parent cda1369c79
commit 31c42c1d02
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 122 additions and 4 deletions

View file

@ -12,6 +12,27 @@ use crate::core::{
};
/// A container that distributes its contents horizontally.
///
/// # Example
/// ```no_run
/// # mod iced { pub mod widget { pub use iced_widget::*; } }
/// # pub type State = ();
/// # pub type Element<'a, Message> = iced_widget::core::Element<'a, Message, iced_widget::Theme, iced_widget::Renderer>;
/// use iced::widget::{button, row};
///
/// #[derive(Debug, Clone)]
/// enum Message {
/// // ...
/// }
///
/// fn view(state: &State) -> Element<'_, Message> {
/// row![
/// "I am to the left!",
/// button("I am in the middle!"),
/// "I am to the right!",
/// ].into()
/// }
/// ```
#[allow(missing_debug_implementations)]
pub struct Row<'a, Message, Theme = crate::Theme, Renderer = crate::Renderer> {
spacing: f32,