summaryrefslogtreecommitdiffstats
path: root/widget/src/row.rs
diff options
context:
space:
mode:
Diffstat (limited to 'widget/src/row.rs')
-rw-r--r--widget/src/row.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/widget/src/row.rs b/widget/src/row.rs
index 20b47a41..4ad806ed 100644
--- a/widget/src/row.rs
+++ b/widget/src/row.rs
@@ -43,7 +43,7 @@ where
pub fn with_children(
children: impl IntoIterator<Item = Element<'a, Message, Theme, Renderer>>,
) -> Self {
- children.into_iter().fold(Self::new(), Self::push)
+ Self::new().extend(children)
}
/// Sets the horizontal spacing _between_ elements.
@@ -118,6 +118,14 @@ where
self
}
}
+
+ /// Extends the [`Row`] with the given children.
+ pub fn extend(
+ self,
+ children: impl IntoIterator<Item = Element<'a, Message, Theme, Renderer>>,
+ ) -> Self {
+ children.into_iter().fold(self, Self::push)
+ }
}
impl<'a, Message, Renderer> Default for Row<'a, Message, Renderer>