feat(widget): add text function with Cow<str> input
This commit is contained in:
parent
f81a06bc4a
commit
b3a3c9c29a
6 changed files with 37 additions and 14 deletions
14
src/widget/text.rs
Normal file
14
src/widget/text.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use std::borrow::Cow;
|
||||
|
||||
pub use iced::widget::Text;
|
||||
|
||||
/// Creates a new [`Text`] widget with the provided content.
|
||||
///
|
||||
/// [`Text`]: widget::Text
|
||||
pub fn text<'a, Renderer>(text: impl Into<Cow<'a, str>>) -> Text<'a, Renderer>
|
||||
where
|
||||
Renderer: iced_native::text::Renderer,
|
||||
Renderer::Theme: iced::widget::text::StyleSheet,
|
||||
{
|
||||
Text::new(text)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue