diff --git a/native/src/widget/column.rs b/native/src/widget/column.rs index 104790d4..e6c795e5 100644 --- a/native/src/widget/column.rs +++ b/native/src/widget/column.rs @@ -42,6 +42,22 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { } } + /// Creates a [`Column`] with children. + /// + /// [`Column`]: struct.Column.html + pub fn new_with_children(children: Vec>) -> Self { + Column { + spacing: 0, + padding: 0, + width: Length::Shrink, + height: Length::Shrink, + max_width: u32::MAX, + max_height: u32::MAX, + align_items: Align::Start, + children, + } + } + /// Sets the vertical spacing _between_ elements. /// /// Custom margins per element do not exist in Iced. You should use this diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs index 775b953e..3d803fa2 100644 --- a/native/src/widget/row.rs +++ b/native/src/widget/row.rs @@ -42,6 +42,22 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> { } } + /// Creates a [`Row`] with children. + /// + /// [`Row`]: struct.Row.html + pub fn new_with_children(children: Vec>) -> Self { + Row { + spacing: 0, + padding: 0, + width: Length::Shrink, + height: Length::Shrink, + max_width: u32::MAX, + max_height: u32::MAX, + align_items: Align::Start, + children, + } + } + /// Sets the horizontal spacing _between_ elements. /// /// Custom margins per element do not exist in Iced. You should use this diff --git a/web/src/widget/column.rs b/web/src/widget/column.rs index 6454ffba..f1d9f9a2 100644 --- a/web/src/widget/column.rs +++ b/web/src/widget/column.rs @@ -37,6 +37,22 @@ impl<'a, Message> Column<'a, Message> { } } + /// Creates a [`Column`] with children. + /// + /// [`Column`]: struct.Column.html + pub fn new_with_children(children: Vec>) -> Self { + Column { + spacing: 0, + padding: 0, + width: Length::Fill, + height: Length::Shrink, + max_width: u32::MAX, + max_height: u32::MAX, + align_items: Align::Start, + children, + } + } + /// Sets the vertical spacing _between_ elements. /// /// Custom margins per element do not exist in Iced. You should use this diff --git a/web/src/widget/row.rs b/web/src/widget/row.rs index 02035113..55077d52 100644 --- a/web/src/widget/row.rs +++ b/web/src/widget/row.rs @@ -37,6 +37,22 @@ impl<'a, Message> Row<'a, Message> { } } + /// Creates a [`Row`] with children. + /// + /// [`Row`]: struct.Row.html + pub fn new_with_children(children: Vec>) -> Self { + Row { + spacing: 0, + padding: 0, + width: Length::Fill, + height: Length::Shrink, + max_width: u32::MAX, + max_height: u32::MAX, + align_items: Align::Start, + children, + } + } + /// Sets the horizontal spacing _between_ elements. /// /// Custom margins per element do not exist in Iced. You should use this