Module zng::widget

source ·
Expand description

Widget info, builder and base, UI node and list.

The Wgt! widget is a blank widget that entirely shaped by properties.

use zng::prelude::*;

Wgt! {
    id = "sun";

    widget::background_gradient = {
        axis: 0.deg(),
        stops: color::gradient::stops![hex!(#ff5226), hex!(#ffc926)],
    };
    layout::size = 100;
    widget::corner_radius = 100;
    layout::align = layout::Align::BOTTOM;

    #[easing(2.secs())]
    layout::y = 100;
    when *#widget::is_inited {
        layout::y = -30;
    }
}

To learn more about the widget macros syntax see widget_set!.

To learn more about how widgets are declared see widget.

To learn more about how properties are declared see property.

§Full API

See zng_app::widget for the full API.

Modules§

Macros§

  • Declares a widget function closure.
  • Implement a property on the widget to strongly associate it with the widget.
  • Sets properties and when condition on a widget builder.

Structs§

Enums§

Statics§

  • Variable that indicates the context should use mobile UI themes.
  • Defines what node list methods can run in parallel in a widget and descendants.

Traits§

Functions§

Attribute Macros§

  • Expands a property assign to include an easing animation.
  • Expands a function to a widget property.
  • Expands an impl block into an UiNode trait implementation.
  • Expands a struct to a widget struct and macro.
  • Expands a struct to a widget mix-in.