diff options
author | 2024-03-18 16:48:15 -0300 | |
---|---|---|
committer | 2024-03-18 16:48:15 -0300 | |
commit | 6146382676a7bff4764e86e99d0d053f5fbbc045 (patch) | |
tree | 5ef765498067ff8db12539650f2c3b52cd6f4bd0 | |
parent | f409037c0766016a9bd22abde5da14406e74959a (diff) | |
download | iced-6146382676a7bff4764e86e99d0d053f5fbbc045.tar.gz iced-6146382676a7bff4764e86e99d0d053f5fbbc045.tar.bz2 iced-6146382676a7bff4764e86e99d0d053f5fbbc045.zip |
feat: add `text` macro to `widget::helpers`
Diffstat (limited to '')
-rw-r--r-- | widget/src/helpers.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 4863e550..1b57cd21 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -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 |