Module vizia::modifiers

source ·
Expand description

Methods on views for changing their properties or for adding actions.

§Examples

Modifiers can be used to apply inline style and layout properties to a view:

// Sets the background color of the label to red.
Label::new(cx, "Hello World")
    .background_color(Color::red());
// Sets the width of the label to be 100 pixels.
Label::new(cx, "Hello World")
    .width(Pixels(100.0));

Modifiers can also be used to add actions to a view:

// Closes the window when the label is pressed.
Label::new(cx, "Hello World")
    .on_press(|cx| cx.emit(WindowEvent::WindowClose));

Modules§

Structs§

Enums§

Traits§