pub struct Rich<'a, Link, Message, Theme = Theme, Renderer = Renderer>{ /* private fields */ }Expand description
A bunch of Rich text.
Implementations§
Source§impl<'a, Link, Message, Theme, Renderer> Rich<'a, Link, Message, Theme, Renderer>
impl<'a, Link, Message, Theme, Renderer> Rich<'a, Link, Message, Theme, Renderer>
Sourcepub fn with_spans(
spans: impl AsRef<[Span<'a, Link, Renderer::Font>]> + 'a,
) -> Self
pub fn with_spans( spans: impl AsRef<[Span<'a, Link, Renderer::Font>]> + 'a, ) -> Self
Creates a new Rich text with the given text spans.
Sourcepub fn line_height(self, line_height: impl Into<LineHeight>) -> Self
pub fn line_height(self, line_height: impl Into<LineHeight>) -> Self
Sets the default [LineHeight] of the Rich text.
Sourcepub fn font(self, font: impl Into<Renderer::Font>) -> Self
pub fn font(self, font: impl Into<Renderer::Font>) -> Self
Sets the default font of the Rich text.
Sourcepub fn width(self, width: impl Into<Length>) -> Self
pub fn width(self, width: impl Into<Length>) -> Self
Sets the width of the Rich text boundaries.
Sourcepub fn height(self, height: impl Into<Length>) -> Self
pub fn height(self, height: impl Into<Length>) -> Self
Sets the height of the Rich text boundaries.
Sourcepub fn align_x(self, alignment: impl Into<Alignment>) -> Self
pub fn align_x(self, alignment: impl Into<Alignment>) -> Self
Sets the [alignment::Horizontal] of the Rich text.
Sourcepub fn align_y(self, alignment: impl Into<Vertical>) -> Self
pub fn align_y(self, alignment: impl Into<Vertical>) -> Self
Sets the [alignment::Vertical] of the Rich text.
Sourcepub fn wrapping(self, wrapping: Wrapping) -> Self
pub fn wrapping(self, wrapping: Wrapping) -> Self
Sets the [Wrapping] strategy of the Rich text.
Sourcepub fn ellipsis(self, ellipsis: Ellipsis) -> Self
pub fn ellipsis(self, ellipsis: Ellipsis) -> Self
Sets the [Ellipsis] strategy of the Rich text.
Sourcepub fn click_interval(self, click_interval: Duration) -> Self
pub fn click_interval(self, click_interval: Duration) -> Self
The maximum delay required for two consecutive clicks to be interpreted as a double click (also applies to triple clicks).
Defaults to 300ms.
Sourcepub fn on_link_click(self, on_link_click: impl Fn(Link) -> Message + 'a) -> Self
pub fn on_link_click(self, on_link_click: impl Fn(Link) -> Message + 'a) -> Self
Sourcepub fn on_link_hover(
self,
on_link_hovered: impl Fn(Link) -> Message + 'a,
) -> Self
pub fn on_link_hover( self, on_link_hovered: impl Fn(Link) -> Message + 'a, ) -> Self
Sets the message that will be produced when a link of the Rich text
is hovered.
Sourcepub fn on_hover_lost(self, on_hover_lost: Message) -> Selfwhere
Message: Clone + 'a,
pub fn on_hover_lost(self, on_hover_lost: Message) -> Selfwhere
Message: Clone + 'a,
Sets the message that will be produced when a link of the Rich text
is no longer hovered.
Sourcepub fn on_hover_lost_with(
self,
on_hover_lost: impl Fn() -> Message + 'a,
) -> Self
pub fn on_hover_lost_with( self, on_hover_lost: impl Fn() -> Message + 'a, ) -> Self
Sets the message that will be produced when a link of the Rich text
is no longer hovered.
Trait Implementations§
Source§impl<'a, Link, Message, Theme, Renderer> Default for Rich<'a, Link, Message, Theme, Renderer>
impl<'a, Link, Message, Theme, Renderer> Default for Rich<'a, Link, Message, Theme, Renderer>
Source§impl<'a, Link, Message, Theme, Renderer> From<Rich<'a, Link, Message, Theme, Renderer>> for Element<'a, Message, Theme, Renderer>
impl<'a, Link, Message, Theme, Renderer> From<Rich<'a, Link, Message, Theme, Renderer>> for Element<'a, Message, Theme, Renderer>
Source§impl<'a, Link, Message, Theme, Renderer> FromIterator<Span<'a, Link, <Renderer as Renderer>::Font>> for Rich<'a, Link, Message, Theme, Renderer>
impl<'a, Link, Message, Theme, Renderer> FromIterator<Span<'a, Link, <Renderer as Renderer>::Font>> for Rich<'a, Link, Message, Theme, Renderer>
Source§impl<Link, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Rich<'_, Link, Message, Theme, Renderer>
impl<Link, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Rich<'_, Link, Message, Theme, Renderer>
Source§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer,
theme: &Theme,
defaults: &Style,
layout: Layout<'_>,
_cursor: Cursor,
viewport: &Rectangle,
)
fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &Theme, defaults: &Style, layout: Layout<'_>, _cursor: Cursor, viewport: &Rectangle, )
Widget] using the associated Renderer.Source§fn update(
&mut self,
tree: &mut Tree,
event: &Event,
layout: Layout<'_>,
cursor: Cursor,
_renderer: &Renderer,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
)
fn update( &mut self, tree: &mut Tree, event: &Event, layout: Layout<'_>, cursor: Cursor, _renderer: &Renderer, shell: &mut Shell<'_, Message>, viewport: &Rectangle, )
Event]. Read more