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§
Sourcefn weight(self, weight: FontWeight) -> Self
fn weight(self, weight: FontWeight) -> Self
Sets the font weight of the label.
Sourcefn line_height_style(self, line_height_style: LineHeightStyle) -> Self
fn line_height_style(self, line_height_style: LineHeightStyle) -> Self
Sets the line height style of the label using a LineHeightStyle.
Sourcefn strikethrough(self) -> Self
fn strikethrough(self) -> Self
Sets the strikethrough property of the label.
Sourcefn alpha(self, alpha: f32) -> Self
fn alpha(self, alpha: f32) -> Self
Sets the alpha property of the label, overwriting the alpha value of the color.
Sourcefn truncate(self) -> Self
fn truncate(self) -> Self
Truncates overflowing text with an ellipsis (…) at the end if needed.
Sourcefn single_line(self) -> Self
fn single_line(self) -> Self
Sets the label to render as a single line.
Sourcefn buffer_font(self, cx: &App) -> Self
fn buffer_font(self, cx: &App) -> Self
Sets the font to the buffer’s
Sourcefn inline_code(self, cx: &App) -> Self
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".