[][src]Struct egui::widgets::Label

#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]pub struct Label { /* fields omitted */ }

Static text.

Implementations

impl Label[src]

pub fn new(text: impl Into<String>) -> Self[src]

pub fn text(&self) -> &str[src]

pub fn multiline(mut self: Self, multiline: bool) -> Self[src]

If true, the text will wrap at the max_width. By default multiline will be true in vertical layouts and horizontal layouts with wrapping, and false on non-wrapping horizontal layouts.

If the text has any newlines (\n) in it, multiline will automatically turn on.

pub fn text_style(mut self: Self, text_style: TextStyle) -> Self[src]

If you do not set a TextStyle, the default style.text_style.

pub fn heading(self) -> Self[src]

pub fn monospace(self) -> Self[src]

pub fn small(self) -> Self[src]

pub fn text_color(mut self: Self, text_color: impl Into<Color32>) -> Self[src]

pub fn layout(&self, ui: &Ui) -> Galley[src]

pub fn layout_width(&self, ui: &Ui, max_width: f32) -> Galley[src]

pub fn font_height(&self, fonts: &Fonts, style: &Style) -> f32[src]

pub fn paint_galley(&self, ui: &mut Ui, pos: Pos2, galley: Galley)[src]

pub fn text_style_or_default(&self, style: &Style) -> TextStyle[src]

Read the text style, or get the default for the current style

Trait Implementations

impl Widget for Label[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.