Type Alias iced::widget::text::Text

pub type Text<'a, Renderer = Renderer<Theme>> = Text<'a, Renderer>;
Expand description

A paragraph.

Aliased Type§

struct Text<'a, Renderer = Renderer<Theme>> { /* private fields */ }

Implementations§

§

impl<'a, Renderer> Text<'a, Renderer>where Renderer: Renderer, <Renderer as Renderer>::Theme: StyleSheet,

pub fn new(content: impl Into<Cow<'a, str>>) -> Text<'a, Renderer>

Available on crate feature advanced only.

Create a new fragment of Text with the given contents.

pub fn size(self, size: impl Into<Pixels>) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the size of the Text.

pub fn line_height( self, line_height: impl Into<LineHeight> ) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the LineHeight of the Text.

pub fn font( self, font: impl Into<<Renderer as Renderer>::Font> ) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the Font of the Text.

pub fn style( self, style: impl Into<<<Renderer as Renderer>::Theme as StyleSheet>::Style> ) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the style of the Text.

pub fn width(self, width: impl Into<Length>) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the width of the Text boundaries.

pub fn height(self, height: impl Into<Length>) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the height of the Text boundaries.

pub fn horizontal_alignment(self, alignment: Horizontal) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the alignment::Horizontal of the Text.

pub fn vertical_alignment(self, alignment: Vertical) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the alignment::Vertical of the Text.

pub fn shaping(self, shaping: Shaping) -> Text<'a, Renderer>

Available on crate feature advanced only.

Sets the Shaping strategy of the Text.

Trait Implementations§

§

impl<'a, Renderer> Clone for Text<'a, Renderer>where Renderer: Renderer, <Renderer as Renderer>::Theme: StyleSheet,

§

fn clone(&self) -> Text<'a, Renderer>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'a, Renderer> From<&'a str> for Text<'a, Renderer>where Renderer: Renderer, <Renderer as Renderer>::Theme: StyleSheet,

§

fn from(content: &'a str) -> Text<'a, Renderer>

Converts to this type from the input type.
§

impl<'a, Message, Renderer> Widget<Message, Renderer> for Text<'a, Renderer>where Renderer: Renderer, <Renderer as Renderer>::Theme: StyleSheet,

§

fn tag(&self) -> Tag

Returns the Tag of the Widget.
§

fn state(&self) -> State

Returns the State of the Widget.
§

fn width(&self) -> Length

Returns the width of the Widget.
§

fn height(&self) -> Length

Returns the height of the Widget.
§

fn layout(&self, tree: &mut Tree, renderer: &Renderer, limits: &Limits) -> Node

Returns the layout::Node of the Widget. Read more
§

fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &<Renderer as Renderer>::Theme, style: &Style, layout: Layout<'_>, _cursor_position: Cursor, _viewport: &Rectangle<f32> )

Draws the Widget using the associated Renderer.
§

fn children(&self) -> Vec<Tree, Global>

Returns the state Tree of the children of the Widget.
§

fn diff(&self, _tree: &mut Tree)

Reconciliates the Widget with the provided Tree.
§

fn operate( &self, _state: &mut Tree, _layout: Layout<'_>, _renderer: &Renderer, _operation: &mut dyn Operation<Message> )

Applies an Operation to the Widget.
§

fn on_event( &mut self, _state: &mut Tree, _event: Event, _layout: Layout<'_>, _cursor: Cursor, _renderer: &Renderer, _clipboard: &mut dyn Clipboard, _shell: &mut Shell<'_, Message>, _viewport: &Rectangle<f32> ) -> Status

Processes a runtime Event. Read more
§

fn mouse_interaction( &self, _state: &Tree, _layout: Layout<'_>, _cursor: Cursor, _viewport: &Rectangle<f32>, _renderer: &Renderer ) -> Interaction

Returns the current mouse::Interaction of the Widget. Read more
§

fn overlay<'a>( &'a mut self, _state: &'a mut Tree, _layout: Layout<'_>, _renderer: &Renderer ) -> Option<Element<'a, Message, Renderer>>

Returns the overlay of the Widget, if there is any.