feat: add text macro to widget::helpers

This commit is contained in:
Richard Custodio 2024-03-18 16:48:15 -03:00
parent f409037c07
commit 6146382676
No known key found for this signature in database
GPG key ID: 95F51F46E2C6E8D7

View file

@ -51,6 +51,19 @@ macro_rules! row {
);
}
/// Creates a new [`Text`] widget with the provided content.
///
/// [`Text`]: core::widget::Text
#[macro_export]
macro_rules! text {
() => (
$crate::Text::new()
);
($($arg:tt)*) => {
$crate::Text::new(format!($($arg)*))
};
}
/// Creates a new [`Container`] with the provided content.
///
/// [`Container`]: crate::Container