DrawLabelText

Structure representing the drawing properties of label text.

Properties

decoratenametypedescription
derefdraw_superDrawTextBase drawing properties inherited from DrawText.
livefocusf32Focus state for the label text.
livehoverf32Hover state for the label text.
livepressedf32Pressed state for the label text.

See DrawText

Example

#![allow(unused)]
fn main() {
{
    draw_super: {
        wrap: Word,
        // real font size = font size * font scale
        font_scale: 1.5,
        text_style: {
            // so here font size = 16 * 1.5 = 24
            font_size: 16,
            font: {path: dep("crate://makepad-widgets/resources/IBMPlexSans-SemiBold.ttf")},
            // brightness > 1.0 will make the text brighter
            // < 1.0 will make the text darker
            brightness: 1.0,
        },
        color: #FF0000,
    },
    // 0.0 is false
    focus: 0.0,
    hover: 1.0,
    pressed: 0.0,
}
}