[go: up one dir, main page]

Enum egui::WidgetText[][src]

pub enum WidgetText {
    RichText(RichText),
    LayoutJob(LayoutJob),
    Galley(Arc<Galley>),
}
Expand description

This is how you specify text for a widget.

A lot of widgets use impl Into<WidgetText> as an argument, allowing you to pass in String, RichText, LayoutJob, and more.

Often a WidgetText is just a simple String, but it can be a RichText (text with color, style, etc), a LayoutJob (for when you want full control of how the text looks) or text that has already been layed out in a Galley.

Variants

RichText(RichText)

Tuple Fields

LayoutJob(LayoutJob)

Tuple Fields

Use this LayoutJob when laying out the text.

Only LayoutJob::text and LayoutJob::sections are guaranteed to be respected.

LayoutJob::wrap_width, LayoutJob::halign, LayoutJob::justify and LayoutJob::first_row_min_height will likely be determined by the crate::Layout of the Ui the widget is placed in. If you want all parts of the LayoutJob respected, then convert it to a Galley and use Self::Galley instead.

Galley(Arc<Galley>)

Tuple Fields

0: Arc<Galley>

Use exactly this galley when painting the text.

Implementations

Override the TextStyle if, and only if, this is a RichText.

Prefer using RichText directly!

Set the TextStyle unless it has already been set

Prefer using RichText directly!

Override text color if, and only if, this is a RichText.

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Prefer using RichText directly!

Layout with wrap mode based on the containing Ui.

wrap: override for Ui::wrap_text.

Trait Implementations

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.