Specialize widget::text helper with custom IntoContent trait
This commit is contained in:
parent
c30b4b0a1c
commit
1d83e59e8a
5 changed files with 78 additions and 10 deletions
|
|
@ -145,13 +145,13 @@ where
|
|||
///
|
||||
/// [`Text`]: core::widget::Text
|
||||
pub fn text<'a, Theme, Renderer>(
|
||||
text: impl ToString,
|
||||
text: impl text::IntoContent<'a>,
|
||||
) -> Text<'a, Theme, Renderer>
|
||||
where
|
||||
Theme: text::Catalog + 'a,
|
||||
Renderer: core::text::Renderer,
|
||||
{
|
||||
Text::new(text.to_string())
|
||||
Text::new(text)
|
||||
}
|
||||
|
||||
/// Creates a new [`Checkbox`].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue