Crate zng_wgt

Source
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§

node
Helper nodes.
prelude
Prelude for declaring properties and widgets.

Structs§

EDITORS
Service that provides editor widgets for a given variable.
EditorRequestArgs
Arguments for EDITORS.register.
ICONS
Service that provides icon drawing widgets.
IconRequestArgs
Arguments for ICONS.register.
OnNodeOpArgs
Arguments for the node operation event properties.
WeakWidgetFn
Weak reference to a WidgetFn<D>.
Wgt
W Minimal widget.
WidgetFn
Boxed shared closure that generates a widget for a given data.

Enums§

HitTestMode
Defines if and how a widget is hit-tested.
InlineMode
Inline mode explicitly selected for a widget.

Statics§

IS_MOBILE_VAR
Variable that indicates the context should use mobile UI themes.

Traits§

CommandIconExt
Adds the icon command metadata.
IconNames
Adapter for ICONS queries.
WidgetInfoBuilderModalExt
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 to true.
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 the corner_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 is Collapsed.
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 is Hidden.
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 the IS_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 is Visible.
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 is modal or descendant of modal.
modal_includes
P Extra widgets that are allowed interaction by this widget when it is modal.
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 Preview on_block event.
on_pre_blocked_changed
P Preview on_blocked_changed event.
on_pre_collapse
P Preview on_collapse event.
on_pre_deinit
P Preview on_deinit event.
on_pre_disable
P Preview on_disable event.
on_pre_enable
P Preview on_enable event.
on_pre_enabled_changed
P Preview on_enabled_changed event.
on_pre_hide
P Preview on_hide event.
on_pre_init
P Preview on_init event.
on_pre_interactivity_changed
P Preview on_interactivity_changed event.
on_pre_move
P Preview on_move event.
on_pre_node_op
P Preview on_node_op event.
on_pre_show
P Preview on_show event.
on_pre_transform_changed
P Preview on_transform_changed event.
on_pre_unblock
P Preview on_unblock event.
on_pre_update
P Preview on_update event.
on_pre_vis_disable
P Preview on_vis_disable event.
on_pre_vis_enable
P Preview on_vis_enable event.
on_pre_vis_enabled_changed
P Preview on_vis_enabled_changed event.
on_pre_visibility_changed
P Preview on_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 Widget update 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.