summaryrefslogtreecommitdiffstats
path: root/widget/src/helpers.rs
diff options
context:
space:
mode:
authorLibravatar Richard Custodio <richardcustodio@pm.me>2024-03-18 16:48:15 -0300
committerLibravatar Richard Custodio <richardcustodio@pm.me>2024-03-18 16:48:15 -0300
commit6146382676a7bff4764e86e99d0d053f5fbbc045 (patch)
tree5ef765498067ff8db12539650f2c3b52cd6f4bd0 /widget/src/helpers.rs
parentf409037c0766016a9bd22abde5da14406e74959a (diff)
downloadiced-6146382676a7bff4764e86e99d0d053f5fbbc045.tar.gz
iced-6146382676a7bff4764e86e99d0d053f5fbbc045.tar.bz2
iced-6146382676a7bff4764e86e99d0d053f5fbbc045.zip
feat: add `text` macro to `widget::helpers`
Diffstat (limited to 'widget/src/helpers.rs')
-rw-r--r--widget/src/helpers.rs13
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