Reintroduce old text helper as value helper
This commit is contained in:
parent
1d83e59e8a
commit
b8d5df2817
2 changed files with 16 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue