pub struct SelectableText<'a, Link, Message> { /* private fields */ }Available on crate feature
selectable-text only.Expand description
Rich text whose links can be clicked and whose text can be selected
inside a SelectionArea. Convert it into an Element to render.
Implementations§
Source§impl<'a, Link, Message> SelectableText<'a, Link, Message>
impl<'a, Link, Message> SelectableText<'a, Link, Message>
pub fn line_height(self, line_height: impl Into<LineHeight>) -> Self
Sourcepub fn color(self, colour: impl Into<Color>) -> Self
pub fn color(self, colour: impl Into<Color>) -> Self
The colour of spans that set none. Defaults to the text colour around the widget.
pub fn width(self, width: impl Into<Length>) -> Self
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
The message for a link that is clicked. Without it links are drawn but do nothing.
Trait Implementations§
Source§impl<Link, Message> Debug for SelectableText<'_, Link, Message>
impl<Link, Message> Debug for SelectableText<'_, Link, Message>
Source§impl<'a, Link, Message> From<SelectableText<'a, Link, Message>> for Element<'a, Message>
impl<'a, Link, Message> From<SelectableText<'a, Link, Message>> for Element<'a, Message>
Source§fn from(text: SelectableText<'a, Link, Message>) -> Self
fn from(text: SelectableText<'a, Link, Message>) -> Self
Converts to this type from the input type.
Source§impl<Link, Message> Widget<Message, Theme, ()> for SelectableText<'_, Link, Message>
impl<Link, Message> Widget<Message, Theme, ()> for SelectableText<'_, Link, Message>
Source§fn operate(
&mut self,
tree: &mut Tree,
layout: Layout<'_>,
_renderer: &Renderer,
operation: &mut dyn Operation,
)
fn operate( &mut self, tree: &mut Tree, layout: Layout<'_>, _renderer: &Renderer, operation: &mut dyn Operation, )
Source§fn update(
&mut self,
tree: &mut Tree,
event: &Event,
layout: Layout<'_>,
cursor: Cursor,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
)
fn update( &mut self, tree: &mut Tree, event: &Event, layout: Layout<'_>, cursor: Cursor, _renderer: &Renderer, _clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, viewport: &Rectangle, )
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 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
Auto Trait Implementations§
impl<'a, Link, Message> !RefUnwindSafe for SelectableText<'a, Link, Message>
impl<'a, Link, Message> !Send for SelectableText<'a, Link, Message>
impl<'a, Link, Message> !Sync for SelectableText<'a, Link, Message>
impl<'a, Link, Message> !UnwindSafe for SelectableText<'a, Link, Message>
impl<'a, Link, Message> Forget for SelectableText<'a, Link, Message>
impl<'a, Link, Message> Freeze for SelectableText<'a, Link, Message>where
*const dyn AsRef<[Span<'a, Link>]> + 'a is !null: Freeze,
PhantomData<dyn AsRef<[Span<'a, Link>]> + 'a>: Freeze,
&'static str: Freeze,
*const dyn Fn(Link) -> Message + 'a is !null: Freeze,
PhantomData<dyn Fn(Link) -> Message + 'a>: Freeze,
*const dyn Fn(&Theme) -> Style + 'a is !null: Freeze,
PhantomData<dyn Fn(&Theme) -> Style + 'a>: Freeze,
impl<'a, Link, Message> Move for SelectableText<'a, Link, Message>
impl<'a, Link, Message> Unpin for SelectableText<'a, Link, Message>
impl<'a, Link, Message> UnsafeUnpin for SelectableText<'a, Link, Message>where
*const dyn AsRef<[Span<'a, Link>]> + 'a is !null: UnsafeUnpin,
PhantomData<dyn AsRef<[Span<'a, Link>]> + 'a>: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const dyn Fn(Link) -> Message + 'a is !null: UnsafeUnpin,
PhantomData<dyn Fn(Link) -> Message + 'a>: UnsafeUnpin,
*const dyn Fn(&Theme) -> Style + 'a is !null: UnsafeUnpin,
PhantomData<dyn Fn(&Theme) -> Style + '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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Turns some type into the initial state of some
Application.