pub struct Label { /* private fields */ }Expand description
A struct representing a label element in the UI.
The Label struct stores the label text and common properties for a label element.
It provides methods for modifying these properties.
§Examples
use ui::prelude::*;
Label::new("Hello, World!");A colored label, for example labeling a dangerous action:
use ui::prelude::*;
let my_label = Label::new("Delete").color(Color::Error);A label with a strikethrough, for example labeling something that has been deleted:
use ui::prelude::*;
let my_label = Label::new("Deleted").strikethrough();Implementations§
Source§impl Label
impl Label
Sourcepub fn new(label: impl Into<SharedString>) -> Self
pub fn new(label: impl Into<SharedString>) -> Self
Sourcepub fn render_code_spans(self) -> Self
pub fn render_code_spans(self) -> Self
When enabled, text wrapped in backticks (e.g. `code`) will be
rendered in the buffer (monospace) font.
Sourcepub fn set_text(&mut self, text: impl Into<SharedString>)
pub fn set_text(&mut self, text: impl Into<SharedString>)
Sets the text of the Label.
Sourcepub fn truncate_start(self) -> Self
pub fn truncate_start(self) -> Self
Truncates the label from the start, keeping the end visible.
Source§impl Label
impl Label
Sourcepub fn m_neg_full(self) -> Self
pub fn m_neg_full(self) -> Self
Sets the margin of the element. Docs
100%
Sourcepub fn m_neg_1_12(self) -> Self
pub fn m_neg_1_12(self) -> Self
Sets the margin of the element. Docs
8% (1/12)
Sourcepub fn mt(self, length: impl Clone + Into<Length>) -> Self
pub fn mt(self, length: impl Clone + Into<Length>) -> Self
Sets the top margin of the element. Docs
Sourcepub fn mt_neg_0p5(self) -> Self
pub fn mt_neg_0p5(self) -> Self
Sets the top margin of the element. Docs
2px (0.125rem)
Sourcepub fn mt_neg_1p5(self) -> Self
pub fn mt_neg_1p5(self) -> Self
Sets the top margin of the element. Docs
6px (0.375rem)
Sourcepub fn mt_neg_2p5(self) -> Self
pub fn mt_neg_2p5(self) -> Self
Sets the top margin of the element. Docs
10px (0.625rem)
Sourcepub fn mt_neg_3p5(self) -> Self
pub fn mt_neg_3p5(self) -> Self
Sets the top margin of the element. Docs
14px (0.875rem)
Sourcepub fn mt_neg_112(self) -> Self
pub fn mt_neg_112(self) -> Self
Sets the top margin of the element. Docs
448px (28rem)
Sourcepub fn mt_neg_128(self) -> Self
pub fn mt_neg_128(self) -> Self
Sets the top margin of the element. Docs
512px (32rem)
Sourcepub fn mt_neg_full(self) -> Self
pub fn mt_neg_full(self) -> Self
Sets the top margin of the element. Docs
100%
Sourcepub fn mt_neg_1_2(self) -> Self
pub fn mt_neg_1_2(self) -> Self
Sets the top margin of the element. Docs
50% (1/2)
Sourcepub fn mt_neg_1_3(self) -> Self
pub fn mt_neg_1_3(self) -> Self
Sets the top margin of the element. Docs
33% (1/3)
Sourcepub fn mt_neg_2_3(self) -> Self
pub fn mt_neg_2_3(self) -> Self
Sets the top margin of the element. Docs
66% (2/3)
Sourcepub fn mt_neg_1_4(self) -> Self
pub fn mt_neg_1_4(self) -> Self
Sets the top margin of the element. Docs
25% (1/4)
Sourcepub fn mt_neg_2_4(self) -> Self
pub fn mt_neg_2_4(self) -> Self
Sets the top margin of the element. Docs
50% (2/4)
Sourcepub fn mt_neg_3_4(self) -> Self
pub fn mt_neg_3_4(self) -> Self
Sets the top margin of the element. Docs
75% (3/4)
Sourcepub fn mt_neg_1_5(self) -> Self
pub fn mt_neg_1_5(self) -> Self
Sets the top margin of the element. Docs
20% (1/5)
Sourcepub fn mt_neg_2_5(self) -> Self
pub fn mt_neg_2_5(self) -> Self
Sets the top margin of the element. Docs
40% (2/5)
Sourcepub fn mt_neg_3_5(self) -> Self
pub fn mt_neg_3_5(self) -> Self
Sets the top margin of the element. Docs
60% (3/5)
Sourcepub fn mt_neg_4_5(self) -> Self
pub fn mt_neg_4_5(self) -> Self
Sets the top margin of the element. Docs
80% (4/5)
Sourcepub fn mt_neg_1_6(self) -> Self
pub fn mt_neg_1_6(self) -> Self
Sets the top margin of the element. Docs
16% (1/6)
Sourcepub fn mt_neg_5_6(self) -> Self
pub fn mt_neg_5_6(self) -> Self
Sets the top margin of the element. Docs
80% (5/6)
Sourcepub fn mt_neg_1_12(self) -> Self
pub fn mt_neg_1_12(self) -> Self
Sets the top margin of the element. Docs
8% (1/12)
Sourcepub fn mb(self, length: impl Clone + Into<Length>) -> Self
pub fn mb(self, length: impl Clone + Into<Length>) -> Self
Sets the bottom margin of the element. Docs
Sourcepub fn mb_neg_0p5(self) -> Self
pub fn mb_neg_0p5(self) -> Self
Sets the bottom margin of the element. Docs
2px (0.125rem)
Sourcepub fn mb_neg_1p5(self) -> Self
pub fn mb_neg_1p5(self) -> Self
Sets the bottom margin of the element. Docs
6px (0.375rem)
Sourcepub fn mb_neg_2p5(self) -> Self
pub fn mb_neg_2p5(self) -> Self
Sets the bottom margin of the element. Docs
10px (0.625rem)
Sourcepub fn mb_neg_3p5(self) -> Self
pub fn mb_neg_3p5(self) -> Self
Sets the bottom margin of the element. Docs
14px (0.875rem)
Sourcepub fn mb_neg_112(self) -> Self
pub fn mb_neg_112(self) -> Self
Sets the bottom margin of the element. Docs
448px (28rem)
Sourcepub fn mb_neg_128(self) -> Self
pub fn mb_neg_128(self) -> Self
Sets the bottom margin of the element. Docs
512px (32rem)
Sourcepub fn mb_neg_full(self) -> Self
pub fn mb_neg_full(self) -> Self
Sets the bottom margin of the element. Docs
100%
Sourcepub fn mb_neg_1_2(self) -> Self
pub fn mb_neg_1_2(self) -> Self
Sets the bottom margin of the element. Docs
50% (1/2)
Sourcepub fn mb_neg_1_3(self) -> Self
pub fn mb_neg_1_3(self) -> Self
Sets the bottom margin of the element. Docs
33% (1/3)
Sourcepub fn mb_neg_2_3(self) -> Self
pub fn mb_neg_2_3(self) -> Self
Sets the bottom margin of the element. Docs
66% (2/3)
Sourcepub fn mb_neg_1_4(self) -> Self
pub fn mb_neg_1_4(self) -> Self
Sets the bottom margin of the element. Docs
25% (1/4)
Sourcepub fn mb_neg_2_4(self) -> Self
pub fn mb_neg_2_4(self) -> Self
Sets the bottom margin of the element. Docs
50% (2/4)
Sourcepub fn mb_neg_3_4(self) -> Self
pub fn mb_neg_3_4(self) -> Self
Sets the bottom margin of the element. Docs
75% (3/4)
Sourcepub fn mb_neg_1_5(self) -> Self
pub fn mb_neg_1_5(self) -> Self
Sets the bottom margin of the element. Docs
20% (1/5)
Sourcepub fn mb_neg_2_5(self) -> Self
pub fn mb_neg_2_5(self) -> Self
Sets the bottom margin of the element. Docs
40% (2/5)
Sourcepub fn mb_neg_3_5(self) -> Self
pub fn mb_neg_3_5(self) -> Self
Sets the bottom margin of the element. Docs
60% (3/5)
Sourcepub fn mb_neg_4_5(self) -> Self
pub fn mb_neg_4_5(self) -> Self
Sets the bottom margin of the element. Docs
80% (4/5)
Sourcepub fn mb_neg_1_6(self) -> Self
pub fn mb_neg_1_6(self) -> Self
Sets the bottom margin of the element. Docs
16% (1/6)
Sourcepub fn mb_neg_5_6(self) -> Self
pub fn mb_neg_5_6(self) -> Self
Sets the bottom margin of the element. Docs
80% (5/6)
Sourcepub fn mb_neg_1_12(self) -> Self
pub fn mb_neg_1_12(self) -> Self
Sets the bottom margin of the element. Docs
8% (1/12)
Sourcepub fn my(self, length: impl Clone + Into<Length>) -> Self
pub fn my(self, length: impl Clone + Into<Length>) -> Self
Sets the vertical margin of the element. Docs
Sourcepub fn my_neg_0p5(self) -> Self
pub fn my_neg_0p5(self) -> Self
Sets the vertical margin of the element. Docs
2px (0.125rem)
Sourcepub fn my_neg_1p5(self) -> Self
pub fn my_neg_1p5(self) -> Self
Sets the vertical margin of the element. Docs
6px (0.375rem)
Sourcepub fn my_neg_2p5(self) -> Self
pub fn my_neg_2p5(self) -> Self
Sets the vertical margin of the element. Docs
10px (0.625rem)
Sourcepub fn my_neg_3p5(self) -> Self
pub fn my_neg_3p5(self) -> Self
Sets the vertical margin of the element. Docs
14px (0.875rem)
Sourcepub fn my_neg_112(self) -> Self
pub fn my_neg_112(self) -> Self
Sets the vertical margin of the element. Docs
448px (28rem)
Sourcepub fn my_neg_128(self) -> Self
pub fn my_neg_128(self) -> Self
Sets the vertical margin of the element. Docs
512px (32rem)
Sourcepub fn my_neg_full(self) -> Self
pub fn my_neg_full(self) -> Self
Sets the vertical margin of the element. Docs
100%
Sourcepub fn my_neg_1_2(self) -> Self
pub fn my_neg_1_2(self) -> Self
Sets the vertical margin of the element. Docs
50% (1/2)
Sourcepub fn my_neg_1_3(self) -> Self
pub fn my_neg_1_3(self) -> Self
Sets the vertical margin of the element. Docs
33% (1/3)
Sourcepub fn my_neg_2_3(self) -> Self
pub fn my_neg_2_3(self) -> Self
Sets the vertical margin of the element. Docs
66% (2/3)
Sourcepub fn my_neg_1_4(self) -> Self
pub fn my_neg_1_4(self) -> Self
Sets the vertical margin of the element. Docs
25% (1/4)
Sourcepub fn my_neg_2_4(self) -> Self
pub fn my_neg_2_4(self) -> Self
Sets the vertical margin of the element. Docs
50% (2/4)
Sourcepub fn my_neg_3_4(self) -> Self
pub fn my_neg_3_4(self) -> Self
Sets the vertical margin of the element. Docs
75% (3/4)
Sourcepub fn my_neg_1_5(self) -> Self
pub fn my_neg_1_5(self) -> Self
Sets the vertical margin of the element. Docs
20% (1/5)
Sourcepub fn my_neg_2_5(self) -> Self
pub fn my_neg_2_5(self) -> Self
Sets the vertical margin of the element. Docs
40% (2/5)
Sourcepub fn my_neg_3_5(self) -> Self
pub fn my_neg_3_5(self) -> Self
Sets the vertical margin of the element. Docs
60% (3/5)
Sourcepub fn my_neg_4_5(self) -> Self
pub fn my_neg_4_5(self) -> Self
Sets the vertical margin of the element. Docs
80% (4/5)
Sourcepub fn my_neg_1_6(self) -> Self
pub fn my_neg_1_6(self) -> Self
Sets the vertical margin of the element. Docs
16% (1/6)
Sourcepub fn my_neg_5_6(self) -> Self
pub fn my_neg_5_6(self) -> Self
Sets the vertical margin of the element. Docs
80% (5/6)
Sourcepub fn my_neg_1_12(self) -> Self
pub fn my_neg_1_12(self) -> Self
Sets the vertical margin of the element. Docs
8% (1/12)
Sourcepub fn mx(self, length: impl Clone + Into<Length>) -> Self
pub fn mx(self, length: impl Clone + Into<Length>) -> Self
Sets the horizontal margin of the element. Docs
Sourcepub fn mx_neg_0p5(self) -> Self
pub fn mx_neg_0p5(self) -> Self
Sets the horizontal margin of the element. Docs
2px (0.125rem)
Sourcepub fn mx_neg_1p5(self) -> Self
pub fn mx_neg_1p5(self) -> Self
Sets the horizontal margin of the element. Docs
6px (0.375rem)
Sourcepub fn mx_neg_2p5(self) -> Self
pub fn mx_neg_2p5(self) -> Self
Sets the horizontal margin of the element. Docs
10px (0.625rem)
Sourcepub fn mx_neg_3p5(self) -> Self
pub fn mx_neg_3p5(self) -> Self
Sets the horizontal margin of the element. Docs
14px (0.875rem)
Sourcepub fn mx_neg_112(self) -> Self
pub fn mx_neg_112(self) -> Self
Sets the horizontal margin of the element. Docs
448px (28rem)
Sourcepub fn mx_neg_128(self) -> Self
pub fn mx_neg_128(self) -> Self
Sets the horizontal margin of the element. Docs
512px (32rem)
Sourcepub fn mx_neg_full(self) -> Self
pub fn mx_neg_full(self) -> Self
Sets the horizontal margin of the element. Docs
100%
Sourcepub fn mx_neg_1_2(self) -> Self
pub fn mx_neg_1_2(self) -> Self
Sets the horizontal margin of the element. Docs
50% (1/2)
Sourcepub fn mx_neg_1_3(self) -> Self
pub fn mx_neg_1_3(self) -> Self
Sets the horizontal margin of the element. Docs
33% (1/3)
Sourcepub fn mx_neg_2_3(self) -> Self
pub fn mx_neg_2_3(self) -> Self
Sets the horizontal margin of the element. Docs
66% (2/3)
Sourcepub fn mx_neg_1_4(self) -> Self
pub fn mx_neg_1_4(self) -> Self
Sets the horizontal margin of the element. Docs
25% (1/4)
Sourcepub fn mx_neg_2_4(self) -> Self
pub fn mx_neg_2_4(self) -> Self
Sets the horizontal margin of the element. Docs
50% (2/4)
Sourcepub fn mx_neg_3_4(self) -> Self
pub fn mx_neg_3_4(self) -> Self
Sets the horizontal margin of the element. Docs
75% (3/4)
Sourcepub fn mx_neg_1_5(self) -> Self
pub fn mx_neg_1_5(self) -> Self
Sets the horizontal margin of the element. Docs
20% (1/5)
Sourcepub fn mx_neg_2_5(self) -> Self
pub fn mx_neg_2_5(self) -> Self
Sets the horizontal margin of the element. Docs
40% (2/5)
Sourcepub fn mx_neg_3_5(self) -> Self
pub fn mx_neg_3_5(self) -> Self
Sets the horizontal margin of the element. Docs
60% (3/5)
Sourcepub fn mx_neg_4_5(self) -> Self
pub fn mx_neg_4_5(self) -> Self
Sets the horizontal margin of the element. Docs
80% (4/5)
Sourcepub fn mx_neg_1_6(self) -> Self
pub fn mx_neg_1_6(self) -> Self
Sets the horizontal margin of the element. Docs
16% (1/6)
Sourcepub fn mx_neg_5_6(self) -> Self
pub fn mx_neg_5_6(self) -> Self
Sets the horizontal margin of the element. Docs
80% (5/6)
Sourcepub fn mx_neg_1_12(self) -> Self
pub fn mx_neg_1_12(self) -> Self
Sets the horizontal margin of the element. Docs
8% (1/12)
Sourcepub fn ml(self, length: impl Clone + Into<Length>) -> Self
pub fn ml(self, length: impl Clone + Into<Length>) -> Self
Sets the left margin of the element. Docs
Sourcepub fn ml_neg_0p5(self) -> Self
pub fn ml_neg_0p5(self) -> Self
Sets the left margin of the element. Docs
2px (0.125rem)
Sourcepub fn ml_neg_1p5(self) -> Self
pub fn ml_neg_1p5(self) -> Self
Sets the left margin of the element. Docs
6px (0.375rem)
Sourcepub fn ml_neg_2p5(self) -> Self
pub fn ml_neg_2p5(self) -> Self
Sets the left margin of the element. Docs
10px (0.625rem)
Sourcepub fn ml_neg_3p5(self) -> Self
pub fn ml_neg_3p5(self) -> Self
Sets the left margin of the element. Docs
14px (0.875rem)
Sourcepub fn ml_neg_112(self) -> Self
pub fn ml_neg_112(self) -> Self
Sets the left margin of the element. Docs
448px (28rem)
Sourcepub fn ml_neg_128(self) -> Self
pub fn ml_neg_128(self) -> Self
Sets the left margin of the element. Docs
512px (32rem)
Sourcepub fn ml_neg_full(self) -> Self
pub fn ml_neg_full(self) -> Self
Sets the left margin of the element. Docs
100%
Sourcepub fn ml_neg_1_2(self) -> Self
pub fn ml_neg_1_2(self) -> Self
Sets the left margin of the element. Docs
50% (1/2)
Sourcepub fn ml_neg_1_3(self) -> Self
pub fn ml_neg_1_3(self) -> Self
Sets the left margin of the element. Docs
33% (1/3)
Sourcepub fn ml_neg_2_3(self) -> Self
pub fn ml_neg_2_3(self) -> Self
Sets the left margin of the element. Docs
66% (2/3)
Sourcepub fn ml_neg_1_4(self) -> Self
pub fn ml_neg_1_4(self) -> Self
Sets the left margin of the element. Docs
25% (1/4)
Sourcepub fn ml_neg_2_4(self) -> Self
pub fn ml_neg_2_4(self) -> Self
Sets the left margin of the element. Docs
50% (2/4)
Sourcepub fn ml_neg_3_4(self) -> Self
pub fn ml_neg_3_4(self) -> Self
Sets the left margin of the element. Docs
75% (3/4)
Sourcepub fn ml_neg_1_5(self) -> Self
pub fn ml_neg_1_5(self) -> Self
Sets the left margin of the element. Docs
20% (1/5)
Sourcepub fn ml_neg_2_5(self) -> Self
pub fn ml_neg_2_5(self) -> Self
Sets the left margin of the element. Docs
40% (2/5)
Sourcepub fn ml_neg_3_5(self) -> Self
pub fn ml_neg_3_5(self) -> Self
Sets the left margin of the element. Docs
60% (3/5)
Sourcepub fn ml_neg_4_5(self) -> Self
pub fn ml_neg_4_5(self) -> Self
Sets the left margin of the element. Docs
80% (4/5)
Sourcepub fn ml_neg_1_6(self) -> Self
pub fn ml_neg_1_6(self) -> Self
Sets the left margin of the element. Docs
16% (1/6)
Sourcepub fn ml_neg_5_6(self) -> Self
pub fn ml_neg_5_6(self) -> Self
Sets the left margin of the element. Docs
80% (5/6)
Sourcepub fn ml_neg_1_12(self) -> Self
pub fn ml_neg_1_12(self) -> Self
Sets the left margin of the element. Docs
8% (1/12)
Sourcepub fn mr(self, length: impl Clone + Into<Length>) -> Self
pub fn mr(self, length: impl Clone + Into<Length>) -> Self
Sets the right margin of the element. Docs
Sourcepub fn mr_neg_0p5(self) -> Self
pub fn mr_neg_0p5(self) -> Self
Sets the right margin of the element. Docs
2px (0.125rem)
Sourcepub fn mr_neg_1p5(self) -> Self
pub fn mr_neg_1p5(self) -> Self
Sets the right margin of the element. Docs
6px (0.375rem)
Sourcepub fn mr_neg_2p5(self) -> Self
pub fn mr_neg_2p5(self) -> Self
Sets the right margin of the element. Docs
10px (0.625rem)
Sourcepub fn mr_neg_3p5(self) -> Self
pub fn mr_neg_3p5(self) -> Self
Sets the right margin of the element. Docs
14px (0.875rem)
Sourcepub fn mr_neg_112(self) -> Self
pub fn mr_neg_112(self) -> Self
Sets the right margin of the element. Docs
448px (28rem)
Sourcepub fn mr_neg_128(self) -> Self
pub fn mr_neg_128(self) -> Self
Sets the right margin of the element. Docs
512px (32rem)
Sourcepub fn mr_neg_full(self) -> Self
pub fn mr_neg_full(self) -> Self
Sets the right margin of the element. Docs
100%
Sourcepub fn mr_neg_1_2(self) -> Self
pub fn mr_neg_1_2(self) -> Self
Sets the right margin of the element. Docs
50% (1/2)
Sourcepub fn mr_neg_1_3(self) -> Self
pub fn mr_neg_1_3(self) -> Self
Sets the right margin of the element. Docs
33% (1/3)
Sourcepub fn mr_neg_2_3(self) -> Self
pub fn mr_neg_2_3(self) -> Self
Sets the right margin of the element. Docs
66% (2/3)
Sourcepub fn mr_neg_1_4(self) -> Self
pub fn mr_neg_1_4(self) -> Self
Sets the right margin of the element. Docs
25% (1/4)
Sourcepub fn mr_neg_2_4(self) -> Self
pub fn mr_neg_2_4(self) -> Self
Sets the right margin of the element. Docs
50% (2/4)
Sourcepub fn mr_neg_3_4(self) -> Self
pub fn mr_neg_3_4(self) -> Self
Sets the right margin of the element. Docs
75% (3/4)
Sourcepub fn mr_neg_1_5(self) -> Self
pub fn mr_neg_1_5(self) -> Self
Sets the right margin of the element. Docs
20% (1/5)
Sourcepub fn mr_neg_2_5(self) -> Self
pub fn mr_neg_2_5(self) -> Self
Sets the right margin of the element. Docs
40% (2/5)
Sourcepub fn mr_neg_3_5(self) -> Self
pub fn mr_neg_3_5(self) -> Self
Sets the right margin of the element. Docs
60% (3/5)
Sourcepub fn mr_neg_4_5(self) -> Self
pub fn mr_neg_4_5(self) -> Self
Sets the right margin of the element. Docs
80% (4/5)
Sourcepub fn mr_neg_1_6(self) -> Self
pub fn mr_neg_1_6(self) -> Self
Sets the right margin of the element. Docs
16% (1/6)
Sourcepub fn mr_neg_5_6(self) -> Self
pub fn mr_neg_5_6(self) -> Self
Sets the right margin of the element. Docs
80% (5/6)
Sourcepub fn mr_neg_1_12(self) -> Self
pub fn mr_neg_1_12(self) -> Self
Sets the right margin of the element. Docs
8% (1/12)
pub fn flex_1(self) -> Self
pub fn flex_none(self) -> Self
pub fn flex_grow(self) -> Self
pub fn flex_shrink(self) -> Self
pub fn flex_shrink_0(self) -> Self
Trait Implementations§
Source§impl Component for Label
impl Component for Label
Source§fn scope() -> ComponentScope
fn scope() -> ComponentScope
Source§fn preview(_window: &mut Window, cx: &mut App) -> Option<AnyElement>
fn preview(_window: &mut Window, cx: &mut App) -> Option<AnyElement>
Source§fn id() -> ComponentId
fn id() -> ComponentId
Source§fn status() -> ComponentStatus
fn status() -> ComponentStatus
Source§impl IntoElement for Label
impl IntoElement for Label
Source§type Element = Component<Label>
type Element = Component<Label>
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl LabelCommon for Label
impl LabelCommon for Label
Source§fn weight(self, weight: FontWeight) -> Self
fn weight(self, weight: FontWeight) -> Self
Sets the weight of the label using a [FontWeight].
§Examples
use gpui::FontWeight;
use ui::prelude::*;
let my_label = Label::new("Hello, World!").weight(FontWeight::BOLD);Source§fn 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.
§Examples
use ui::prelude::*;
let my_label = Label::new("Hello, World!").line_height_style(LineHeightStyle::UiLabel);Source§fn strikethrough(self) -> Self
fn strikethrough(self) -> Self
Sets the strikethrough property of the label.
§Examples
use ui::prelude::*;
let my_label = Label::new("Hello, World!").strikethrough();Source§fn italic(self) -> Self
fn italic(self) -> Self
Sets the italic property of the label.
§Examples
use ui::prelude::*;
let my_label = Label::new("Hello, World!").italic();Source§fn alpha(self, alpha: f32) -> Self
fn alpha(self, alpha: f32) -> Self
Sets the alpha property of the color of label.
§Examples
use ui::prelude::*;
let my_label = Label::new("Hello, World!").alpha(0.5);Source§fn inline_code(self, cx: &App) -> Self
fn inline_code(self, cx: &App) -> Self
Styles the label to look like inline code.
Source§fn single_line(self) -> Self
fn single_line(self) -> Self
Source§fn buffer_font(self, cx: &App) -> Self
fn buffer_font(self, cx: &App) -> Self
Source§impl RenderOnce for Label
impl RenderOnce for Label
Source§fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for Label
impl !Send for Label
impl !Sync for Label
impl !UnwindSafe for Label
impl Freeze for Label
impl Unpin for Label
impl UnsafeUnpin for Label
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CommonAnimationExt for Twhere
T: AnimationExt,
impl<T> CommonAnimationExt for Twhere
T: AnimationExt,
Source§fn with_rotate_animation(self, duration: u64) -> AnimationElement<Self>where
Self: Transformable + Sized,
fn with_rotate_animation(self, duration: u64) -> AnimationElement<Self>where
Self: Transformable + Sized,
Source§fn with_keyed_rotate_animation(
self,
id: impl Into<ElementId>,
duration: u64,
) -> AnimationElement<Self>where
Self: Transformable + Sized,
fn with_keyed_rotate_animation(
self,
id: impl Into<ElementId>,
duration: u64,
) -> AnimationElement<Self>where
Self: Transformable + Sized,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more