pub struct Rich<'a, Link, Message, Theme = Theme>{ /* private fields */ }Expand description
A bunch of Rich text.
Implementations§
Source§impl<'a, Link, Message, Theme> Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme> Rich<'a, Link, Message, Theme>
Sourcepub fn with_spans(spans: impl AsRef<[Span<'a, Link>]> + 'a) -> Self
pub fn with_spans(spans: impl AsRef<[Span<'a, Link>]> + '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_maybe(self, font: impl Into<Option<Font>>) -> Self
pub fn font_maybe(self, font: impl Into<Option<Font>>) -> Self
Sets the default font of the Rich text, if Some.
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 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> FromIterator<Span<'a, Link>> for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme> FromIterator<Span<'a, Link>> for Rich<'a, Link, Message, Theme>
Source§impl<Link, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Rich<'_, Link, Message, Theme>
impl<Link, Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Rich<'_, Link, Message, Theme>
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, )
Draws the
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, )
Source§fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout,
cursor: Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, tree: &Tree, layout: Layout, cursor: Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction
Source§fn operate(
&mut self,
_tree: &mut Tree,
_layout: Layout,
_viewport: &Rectangle,
_renderer: &Renderer,
_operation: &mut dyn Operation,
)
fn operate( &mut self, _tree: &mut Tree, _layout: Layout, _viewport: &Rectangle, _renderer: &Renderer, _operation: &mut dyn Operation, )
Source§fn overlay<'a>(
&'a mut self,
_tree: &'a mut Tree,
_layout: Layout,
_renderer: &Renderer,
_viewport: &Rectangle,
_translation: Vector,
_window: Size,
) -> Vec<Element<'a, Message, Theme, Renderer>>
fn overlay<'a>( &'a mut self, _tree: &'a mut Tree, _layout: Layout, _renderer: &Renderer, _viewport: &Rectangle, _translation: Vector, _window: Size, ) -> Vec<Element<'a, Message, Theme, Renderer>>
Returns the overlays of the
Widget.Auto Trait Implementations§
impl<'a, Link, Message, Theme = Theme> !RefUnwindSafe for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme = Theme> !Send for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme = Theme> !Sync for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme = Theme> !UnwindSafe for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme> Freeze for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme> Unpin for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme> UnsafeUnpin for Rich<'a, Link, Message, Theme>where
Box<dyn AsRef<[Span<'a, Link>]> + 'a>: UnsafeUnpin,
<Theme as Catalog>::Class<'a>: UnsafeUnpin,
Option<Box<dyn Fn(Link) -> Message + 'a>>: UnsafeUnpin,
Option<Box<dyn Fn() -> Message + 'a>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more