Skip to main content

LabelCommon

Trait LabelCommon 

Source
pub trait LabelCommon {
    // Required methods
    fn size(self, size: LabelSize) -> Self;
    fn weight(self, weight: FontWeight) -> Self;
    fn line_height_style(self, line_height_style: LineHeightStyle) -> Self;
    fn color(self, color: Color) -> Self;
    fn strikethrough(self) -> Self;
    fn italic(self) -> Self;
    fn underline(self) -> Self;
    fn alpha(self, alpha: f32) -> Self;
    fn truncate(self) -> Self;
    fn single_line(self) -> Self;
    fn buffer_font(self, cx: &App) -> Self;
    fn inline_code(self, cx: &App) -> Self;
}
Expand description

A common set of traits all labels must implement.

Required Methods§

Source

fn size(self, size: LabelSize) -> Self

Sets the size of the label using a LabelSize.

Source

fn weight(self, weight: FontWeight) -> Self

Sets the font weight of the label.

Source

fn line_height_style(self, line_height_style: LineHeightStyle) -> Self

Sets the line height style of the label using a LineHeightStyle.

Source

fn color(self, color: Color) -> Self

Sets the color of the label using a Color.

Source

fn strikethrough(self) -> Self

Sets the strikethrough property of the label.

Source

fn italic(self) -> Self

Sets the italic property of the label.

Source

fn underline(self) -> Self

Sets the underline property of the label

Source

fn alpha(self, alpha: f32) -> Self

Sets the alpha property of the label, overwriting the alpha value of the color.

Source

fn truncate(self) -> Self

Truncates overflowing text with an ellipsis () at the end if needed.

Source

fn single_line(self) -> Self

Sets the label to render as a single line.

Source

fn buffer_font(self, cx: &App) -> Self

Sets the font to the buffer’s

Source

fn inline_code(self, cx: &App) -> Self

Styles the label to look like inline code.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§