diff options
Diffstat (limited to 'native/src/widget/row.rs')
-rw-r--r-- | native/src/widget/row.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs index 775b953e..c8812ea2 100644 --- a/native/src/widget/row.rs +++ b/native/src/widget/row.rs @@ -30,6 +30,15 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> { /// /// [`Row`]: struct.Row.html pub fn new() -> Self { + Self::with_children(Vec::new()) + } + + /// Creates a [`Row`] with the given elements. + /// + /// [`Row`]: struct.Row.html + pub fn with_children( + children: Vec<Element<'a, Message, Renderer>>, + ) -> Self { Row { spacing: 0, padding: 0, @@ -38,7 +47,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> { max_width: u32::MAX, max_height: u32::MAX, align_items: Align::Start, - children: Vec::new(), + children, } } |