Merge pull request #2904 from edwloef/grid-helper
Add `grid!` macro helper
This commit is contained in:
commit
93735975b7
1 changed files with 13 additions and 0 deletions
|
|
@ -113,6 +113,19 @@ macro_rules! stack {
|
|||
);
|
||||
}
|
||||
|
||||
/// Creates a [`Grid`] with the given children.
|
||||
///
|
||||
/// [`Grid`]: crate::Grid
|
||||
#[macro_export]
|
||||
macro_rules! grid {
|
||||
() => (
|
||||
$crate::Grid::new()
|
||||
);
|
||||
($($x:expr),+ $(,)?) => (
|
||||
$crate::Grid::with_children([$($crate::core::Element::from($x)),+])
|
||||
);
|
||||
}
|
||||
|
||||
/// Creates a new [`Text`] widget with the provided content.
|
||||
///
|
||||
/// [`Text`]: core::widget::Text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue