[−][src]Struct iced::widget::text::Text
A fragment of text with a generic Color
.
It implements Widget
when the associated Renderer
implements the
text::Renderer
trait.
Example
use iced::Text; #[derive(Debug, Clone, Copy)] pub enum Color { Black, } Text::new("I <3 iced!") .size(40) .color(Color::Black);
Methods
impl<Color> Text<Color>
[src]
pub fn new(label: &str) -> Self
[src]
Create a new fragment of Text
with the given contents.
pub fn size(self, size: u16) -> Self
[src]
Sets the size of the Text
in pixels.
pub fn color(self, color: Color) -> Self
[src]
Sets the Color
of the Text
.
pub fn width(self, width: u16) -> Self
[src]
Sets the width of the Text
boundaries in pixels.
pub fn height(self, height: u16) -> Self
[src]
Sets the height of the Text
boundaries in pixels.
pub fn horizontal_alignment(self, alignment: HorizontalAlignment) -> Self
[src]
Sets the HorizontalAlignment
of the Text
.
pub fn vertical_alignment(self, alignment: VerticalAlignment) -> Self
[src]
Sets the VerticalAlignment
of the Text
.
Trait Implementations
impl<Message, Renderer, Color> Widget<Message, Renderer> for Text<Color> where
Color: Copy + Debug,
Renderer: Renderer<Color>,
[src]
Color: Copy + Debug,
Renderer: Renderer<Color>,
fn node(&self, renderer: &Renderer) -> Node
[src]
fn draw(
&self,
renderer: &mut Renderer,
layout: Layout,
_cursor_position: Point
) -> MouseCursor
[src]
&self,
renderer: &mut Renderer,
layout: Layout,
_cursor_position: Point
) -> MouseCursor
fn hash_layout(&self, state: &mut Hasher)
[src]
fn on_event(
&mut self,
_event: Event,
_layout: Layout,
_cursor_position: Point,
_messages: &mut Vec<Message>
)
[src]
&mut self,
_event: Event,
_layout: Layout,
_cursor_position: Point,
_messages: &mut Vec<Message>
)
impl<Color: Clone> Clone for Text<Color>
[src]
impl<'a, Message, Renderer, Color> From<Text<Color>> for Element<'a, Message, Renderer> where
Color: 'static + Copy + Debug,
Renderer: Renderer<Color>,
[src]
Color: 'static + Copy + Debug,
Renderer: Renderer<Color>,
impl<Color: Debug> Debug for Text<Color>
[src]
Auto Trait Implementations
impl<Color> Sync for Text<Color> where
Color: Sync,
Color: Sync,
impl<Color> Send for Text<Color> where
Color: Send,
Color: Send,
impl<Color> Unpin for Text<Color> where
Color: Unpin,
Color: Unpin,
impl<Color> UnwindSafe for Text<Color> where
Color: UnwindSafe,
Color: UnwindSafe,
impl<Color> RefUnwindSafe for Text<Color> where
Color: RefUnwindSafe,
Color: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,