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§
- Widget and property builder types.
- Widget info tree and info builder.
- Widget node types,
UiNode
,UiNodeList
and others.
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§
- Coordinates nested borders and corner-radius.
- The line style and color for the sides of a widget’s border.
- The line style and color for each side of a widget’s border.
- Radius of each corner of a border defined from
Size
values. - Service that provides editor widgets for a given variable.
- Arguments for
EDITORS.register
. - Base widget for types that build to a custom type that is not used as a part of the UI tree.
- Arguments for the node operation event properties.
- Node list methods that are made parallel.
- Current context widget.
- Weak reference to a
WidgetFn<D>
. W
Minimal widget.- Base widget.
- Boxed shared closure that generates a widget for a given data.
- Unique ID of a widget.
- Position of a widget inside an
UiNodeList
render operation.
Enums§
- The line style for the sides of a widget’s border.
- Defines how the corner radius is computed for each usage.
- Defines if and how a widget is hit-tested.
- Orientation of a straight line.
- Represents a line style.
- Widget visibility.
- Defines how widget update requests inside
WIDGET::with_context
are handled.
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§
- Trait implemented by all
#[widget]
.
Functions§
P
Defines if the widget only renders if it’s bounds intersects with the viewport auto-hide rectangle.P
Custom background. Allows using any other UI node as a background.P
Fill color background.P
Conic gradient background.P
Custom background generated using aWidgetFn<()>
.P
Linear gradient background.P
Radial gradient background.P
Border widths, color and style.P
Position of a widget borders in relation to the widget fill.P
If the border is rendered over the fill and child visuals.P
Clips the widget child to the area of the widget when set totrue
.P
Corner radius of widget and inner widgets.P
Defines how thecorner_radius
is computed for each usage.P
Defines if default interaction is allowed in the widget and its descendants.P
Custom foreground fill. Allows using any other UI node as a foreground overlay.P
Fill color overlay.P
Conic gradient foreground.P
Custom foreground generated using aWidgetFn<()>
.P
Linear gradient overlay.P
Foreground highlight border overlay.P
Radial gradient foreground.P
Defines if and how the widget is hit-tested.P
Enforce an inline mode on the widget.P
Defines if any interaction is allowed in the widget and its descendants.P
If the widget isCollapsed
.P
If the widget is disabled for interaction.P
If the widget is enabled for interaction.P
If the widget isHidden
.P
If the widget is visible for hit-tests.P
If the widget has been initialized.P
Gets theIS_MOBILE_VAR
that indicates the window or widget should use mobile UI themes.P
If the widget isVisible
.P
Only allow interaction inside the widget, descendants and ancestors.P
Include itself in the allow list of another widget that ismodal
or descendant of modal.P
Extra widgets that are allowed interaction by this widget when it ismodal
.P
Widget interactions now blocked.P
Widget interactions where blocked or unblocked.P
Widget visibility changed to collapsed.P
Widget deinited.P
Widget normal interactions now disabled.P
Widget normal interactions now enabled.P
Widget was enabled or disabled.P
Widget visibility changed to hidden.P
Widget info is now available.P
Widget initialized.P
Widget interactivity changed.P
Widget global position changed.P
On any node operation.P
Previewon_block
event.P
Previewon_blocked_changed
event.P
Previewon_collapse
event.P
Previewon_deinit
event.P
Previewon_disable
event.P
Previewon_enable
event.P
Previewon_enabled_changed
event.P
Previewon_hide
event.P
Previewon_init
event.P
Previewon_interactivity_changed
event.P
Previewon_move
event.P
Previewon_node_op
event.P
Previewon_show
event.P
Previewon_transform_changed
event.P
Previewon_unblock
event.P
Previewon_update
event.P
Previewon_vis_disable
event.P
Previewon_vis_enable
event.P
Previewon_vis_enabled_changed
event.P
Previewon_visibility_changed
event.P
Widget visibility changed to visible.P
Widget global inner transform changed.P
Widget interactions now unblocked.P
Widgetupdate
event.P
Widget now looks disabled.P
Widget now looks enabled.P
Widget changed to enabled or disabled visuals.P
Widget visibility changed.P
Defines what node list methods can run in parallel in the widget and descendants.P
Sets the widget visibility.P
Defines the render order of a widget in a layout panel.
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.