Expand description
Basic widget properties and helpers for declaring widgets and properties.
§Widget Instantiation
See enable_widget_macros!
if you want to instantiate widgets without depending on the zng
crate.
§Crate
This crate is part of the zng
project.
§Cargo Features
This crate provides 3 feature flags, 1 enabled by default.
§"debug_default"
Signal the build script to enable the "dyn_*"
, "inspector"
and "trace_widget"
features in debug builds.
Enabled by default.
§"dyn_closure"
Box closures at opportune places, such as Var::map
, reducing the number of monomorphised types.
This speeds-up compilation time at the cost of runtime.
§"http"
Enable web tasks.
Modules§
Structs§
- EDITORS
- Service that provides editor widgets for a given variable.
- Editor
Request Args - Arguments for
EDITORS.register
. - ICONS
- Service that provides icon drawing widgets.
- Icon
Request Args - Arguments for
ICONS.register
. - OnNode
OpArgs - Arguments for the node operation event properties.
- Weak
Widget Fn - Weak reference to a
WidgetFn<D>
. - Wgt
W
Minimal widget.- Widget
Fn - Boxed shared closure that generates a widget for a given data.
Enums§
- HitTest
Mode - Defines if and how a widget is hit-tested.
- Inline
Mode - Inline mode explicitly selected for a widget.
Statics§
- IS_
MOBILE_ VAR - Variable that indicates the context should use mobile UI themes.
Traits§
- Command
Icon Ext - Adds the
icon
command metadata. - Icon
Names - Adapter for
ICONS
queries. - Widget
Info Builder Modal Ext - Widget info builder extensions for
modal
control.
Functions§
- accent_
color P
Defines the preferred accent color in the widget and descendants.- align
P
Aligns the widget within the available space.- auto_
hide P
Defines if the widget only renders if it’s bounds intersects with the viewport auto-hide rectangle.- base_
color P
Defines the seed color used by widgets to derive background, non active border.- border
P
Border widths, color and style.- border_
align P
Position of a widget borders in relation to the widget fill.- border_
over P
If the border is rendered over the fill and child visuals.- clip_
to_ bounds P
Clips the widget child to the area of the widget when set totrue
.- color_
scheme P
Defines the preferred color scheme in the widget and descendants.- corner_
radius P
Corner radius of widget and inner widgets.- corner_
radius_ fit P
Defines how thecorner_radius
is computed for each usage.- enabled
P
Defines if default interaction is allowed in the widget and its descendants.- force_
mobile P
Requests mobile UI themes in desktop builds.- hit_
test_ mode P
Defines if and how the widget is hit-tested.- inline
P
Enforce an inline mode on the widget.- interactive
P
Defines if any interaction is allowed in the widget and its descendants.- is_
collapsed P
If the widget isCollapsed
.- is_
disabled P
If the widget is disabled for interaction.- is_
enabled P
If the widget is enabled for interaction.- is_
hidden P
If the widget isHidden
.- is_
hit_ testable P
If the widget is visible for hit-tests.- is_
inited P
If the widget has been initialized.- is_ltr
P
If the layout direction is left-to-right.- is_
mobile P
Gets theIS_MOBILE_VAR
that indicates the window or widget should use mobile UI themes.- is_rtl
P
If the layout direction is right-to-left.- is_
visible P
If the widget isVisible
.- margin
P
Margin space around the widget.- modal
P
Only allow interaction inside the widget, descendants and ancestors.- modal_
included P
Include itself in the allow list of another widget that ismodal
or descendant of modal.- modal_
includes P
Extra widgets that are allowed interaction by this widget when it ismodal
.- on_
block P
Widget interactions now blocked.- on_
blocked_ changed P
Widget interactions where blocked or unblocked.- on_
collapse P
Widget visibility changed to collapsed.- on_
deinit P
Widget deinited.- on_
disable P
Widget normal interactions now disabled.- on_
enable P
Widget normal interactions now enabled.- on_
enabled_ changed P
Widget was enabled or disabled.- on_hide
P
Widget visibility changed to hidden.- on_
info_ init P
Widget info is now available.- on_init
P
Widget initialized.- on_
interactivity_ changed P
Widget interactivity changed.- on_move
P
Widget global position changed.- on_
node_ op P
On any node operation.- on_
pre_ block P
Previewon_block
event.- on_
pre_ blocked_ changed P
Previewon_blocked_changed
event.- on_
pre_ collapse P
Previewon_collapse
event.- on_
pre_ deinit P
Previewon_deinit
event.- on_
pre_ disable P
Previewon_disable
event.- on_
pre_ enable P
Previewon_enable
event.- on_
pre_ enabled_ changed P
Previewon_enabled_changed
event.- on_
pre_ hide P
Previewon_hide
event.- on_
pre_ init P
Previewon_init
event.- on_
pre_ interactivity_ changed P
Previewon_interactivity_changed
event.- on_
pre_ move P
Previewon_move
event.- on_
pre_ node_ op P
Previewon_node_op
event.- on_
pre_ show P
Previewon_show
event.- on_
pre_ transform_ changed P
Previewon_transform_changed
event.- on_
pre_ unblock P
Previewon_unblock
event.- on_
pre_ update P
Previewon_update
event.- on_
pre_ vis_ disable P
Previewon_vis_disable
event.- on_
pre_ vis_ enable P
Previewon_vis_enable
event.- on_
pre_ vis_ enabled_ changed P
Previewon_vis_enabled_changed
event.- on_
pre_ visibility_ changed P
Previewon_visibility_changed
event.- on_show
P
Widget visibility changed to visible.- on_
transform_ changed P
Widget global inner transform changed.- on_
unblock P
Widget interactions now unblocked.- on_
update P
Widgetupdate
event.- on_
vis_ disable P
Widget now looks disabled.- on_
vis_ enable P
Widget now looks enabled.- on_
vis_ enabled_ changed P
Widget changed to enabled or disabled visuals.- on_
visibility_ changed P
Widget visibility changed.- parallel
P
Defines what node list methods can run in parallel in the widget and descendants.- visibility
P
Sets the widget visibility.- z_index
P
Defines the render order of a widget in a layout panel.