add macro helper for grid
This commit is contained in:
parent
afc562d336
commit
5451208ab8
1 changed files with 13 additions and 0 deletions
|
|
@ -110,6 +110,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.
|
/// Creates a new [`Text`] widget with the provided content.
|
||||||
///
|
///
|
||||||
/// [`Text`]: core::widget::Text
|
/// [`Text`]: core::widget::Text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue