Reintroduce old text helper as value helper

This commit is contained in:
Héctor Ramón Jiménez 2024-04-01 21:36:52 +02:00
parent 1d83e59e8a
commit b8d5df2817
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 16 additions and 9 deletions

View file

@ -154,6 +154,19 @@ where
Text::new(text)
}
/// Creates a new [`Text`] widget that displays the provided value.
///
/// [`Text`]: core::widget::Text
pub fn value<'a, Theme, Renderer>(
value: impl ToString,
) -> Text<'a, Theme, Renderer>
where
Theme: text::Catalog + 'a,
Renderer: core::text::Renderer,
{
Text::new(value.to_string())
}
/// Creates a new [`Checkbox`].
///
/// [`Checkbox`]: crate::Checkbox