Instantiate Column and Row with children
This commit is contained in:
parent
e1438774af
commit
ae123d8f14
@ -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<Element<'a, Message, Renderer>>) -> 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
|
||||
|
@ -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<Element<'a, Message, Renderer>>) -> 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
|
||||
|
@ -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<Element<'a, Message>>) -> 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
|
||||
|
@ -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<Element<'a, Message>>) -> 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
|
||||
|
Loading…
Reference in New Issue
Block a user