summaryrefslogtreecommitdiffstats
path: root/web/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-17 03:23:10 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-17 03:23:10 +0100
commitc7583f12270082dc2f4d766aea50be7bd49b6c50 (patch)
treebf4529c0deec92a72f72a157b35299b6d1e7d4de /web/src
parenta373682fa4e8d57d66707faef1fb6b373f4297eb (diff)
parent9da6ce474c2cd178ca5365d46760ba0882ce7121 (diff)
downloadiced-c7583f12270082dc2f4d766aea50be7bd49b6c50.tar.gz
iced-c7583f12270082dc2f4d766aea50be7bd49b6c50.tar.bz2
iced-c7583f12270082dc2f4d766aea50be7bd49b6c50.zip
Merge branch 'master' into feature/panes-widget
Diffstat (limited to 'web/src')
-rw-r--r--web/src/widget/column.rs9
-rw-r--r--web/src/widget/row.rs9
2 files changed, 16 insertions, 2 deletions
diff --git a/web/src/widget/column.rs b/web/src/widget/column.rs
index 6454ffba..25b88b0e 100644
--- a/web/src/widget/column.rs
+++ b/web/src/widget/column.rs
@@ -25,6 +25,13 @@ impl<'a, Message> Column<'a, Message> {
///
/// [`Column`]: struct.Column.html
pub fn new() -> Self {
+ Self::with_children(Vec::new())
+ }
+
+ /// Creates a [`Column`] with the given elements.
+ ///
+ /// [`Column`]: struct.Column.html
+ pub fn with_children(children: Vec<Element<'a, Message>>) -> Self {
Column {
spacing: 0,
padding: 0,
@@ -33,7 +40,7 @@ impl<'a, Message> Column<'a, Message> {
max_width: u32::MAX,
max_height: u32::MAX,
align_items: Align::Start,
- children: Vec::new(),
+ children,
}
}
diff --git a/web/src/widget/row.rs b/web/src/widget/row.rs
index 02035113..cfa10fdf 100644
--- a/web/src/widget/row.rs
+++ b/web/src/widget/row.rs
@@ -25,6 +25,13 @@ impl<'a, Message> Row<'a, Message> {
///
/// [`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>>) -> Self {
Row {
spacing: 0,
padding: 0,
@@ -33,7 +40,7 @@ impl<'a, Message> Row<'a, Message> {
max_width: u32::MAX,
max_height: u32::MAX,
align_items: Align::Start,
- children: Vec::new(),
+ children,
}
}