GLabel

A custom label widget with various configurable properties such as color, font size, brightness, line spacing, and more.

Example

#![allow(unused)]
fn main() {
use makepad_widgets::*;

live_design! {
    import makepad_widgets::base::*;
    import makepad_widgets::theme_desktop_dark::*; 
    import gen_components::components::*;

    GLabelExample = <ScrollYView>{
        height: 100.0,
        width: Fill,
        spacing: 10.0,
        <Label>{
            text: "GLabel"
        }
        <GLabel>{
            text: "Hello, world! This is a long message, but I use wrap Word to wrap it!",
            height: 48.0,
            width: 120.0,
            wrap: Word,
            brightness: 1.5,
            margin: {left: 12.0},
        }
        <GLabel>{
            text: "bold, test bold!!",
            font_size: 12.0,
            padding: 16.0,
            color: #FF0000,
            font_family: dep("E:/Rust/try/makepad/Gen-UI/examples/gen_widget_example/resources/GoNotoKurrent-Bold.ttf"),
        }
    }
}
}

Props

decoratenametypedescription
livecolorVec4The color of the label.
livefont_sizef64The size of the font used in the label.
livebrightnessf32The brightness level of the text.
livecurvef32The curve factor of the text.
liveline_spacingf64The line spacing of the text.
livetop_dropf64The top drop of the text.
liveheight_factorf64The height factor of the text.
livewrapTextWrapThe text wrapping mode.
livefont_familyLiveDependencyThe font family of the text.
livevisibleboolWhether the label is visible.
derefdraw_textDrawTextThe DrawText component used for drawing the text.
walkwalkWalkThe Walk component for positioning.
livealignAlignThe alignment of the text.
livepaddingPaddingThe padding around the text.
livetextRcStringMutThe content of the label.

Event

namedescription
NoneNo events are specified for this widget.