diff options
author | 2020-03-24 19:08:21 +0100 | |
---|---|---|
committer | 2020-03-24 19:08:21 +0100 | |
commit | e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006 (patch) | |
tree | 78608f77c6db3ff1e61a58008bd54d114f32352c /native/src/widget/column.rs | |
parent | 7cb1452d29ddfdcd29fd7ecc7c96a79ea2681fce (diff) | |
parent | fd7d9622e333a0a2cd5c2e8e6cc38cc09d7981e4 (diff) | |
download | iced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.tar.gz iced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.tar.bz2 iced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.zip |
Merge branch 'master' into feature/text-selection
Diffstat (limited to 'native/src/widget/column.rs')
-rw-r--r-- | native/src/widget/column.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/native/src/widget/column.rs b/native/src/widget/column.rs index 104790d4..b1adc6e3 100644 --- a/native/src/widget/column.rs +++ b/native/src/widget/column.rs @@ -30,6 +30,15 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { /// /// [`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, Renderer>>, + ) -> Self { Column { spacing: 0, padding: 0, @@ -38,7 +47,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { max_width: u32::MAX, max_height: u32::MAX, align_items: Align::Start, - children: Vec::new(), + children, } } @@ -210,7 +219,7 @@ pub trait Renderer: crate::Renderer + Sized { /// - the [`Layout`] of the [`Column`] and its children /// - the cursor position /// - /// [`Column`]: struct.Row.html + /// [`Column`]: struct.Column.html /// [`Layout`]: ../layout/struct.Layout.html fn draw<Message>( &mut self, |