Crate zng_wgt_toggle

Source
Expand description

Toggle widget, properties and commands.

§Crate

This crate is part of the zng project.

Modules§

cmd
Commands that control toggle.

Structs§

CheckStyle
W Checkmark toggle style.
ComboStyle
W Popup toggle style.
DefaultStyle
W Default toggle style.
LightStyle
W Toggle light style.
RadioStyle
W Radio toggle style.
Selector
Represents the contextual selector behavior of value selector.
SwitchStyle
W Switch toggle style.
Toggle
W A toggle button that flips a bool or Option<bool> variable on click, or selects a value.

Enums§

SelectorError
Error for Selector operations.

Statics§

CHECK_SPACING_VAR
Spacing between the checkmark and the content.
COMBO_SPACING_VAR
Spacing between the arrow symbol and the content.
DESELECT_ON_DEINIT_VAR
If value is deselected when the widget that has the value is deinited and the value was selected.
DESELECT_ON_NEW_VAR
If value deselects the previously selected value when the variable changes.
IS_CHECKED_VAR
The toggle button checked state.
IS_TRISTATE_VAR
If toggle button cycles between None, Some(false) and Some(true) on click.
RADIO_SPACING_VAR
Spacing between the radio and the content.
SCROLL_ON_SELECT_VAR
If value scrolls into view when selected.
SELECTOR
Contextual Selector.
SELECT_ON_INIT_VAR
If value is selected when the widget that has the value is inited.
SELECT_ON_NEW_VAR
If value selects the new value when the variable changes and the previous value was selected.
STYLE_FN_VAR
Contextual style variable.
SWITCH_SPACING_VAR
Spacing between the switch and the content.

Traits§

SelectorImpl
Represents a Selector implementation.

Functions§

check_spacing
P Spacing between the checkmark and the content.
checked
P Toggle cycles between true and false, updating the variable.
checked_opt
P Toggle cycles between Some(true) and Some(false) and accepts None, if the widget is tristate also sets to None in the toggle cycle.
checked_popup
P Popup open when the toggle button is checked.
combo_spacing
P Spacing between the arrow symbol and the content.
deselect_on_deinit
P If value is deselected when the widget that has the value is deinited and the value was selected.
deselect_on_new
P If value deselects the previously selected value when the variable changes.
is_checked
P If the toggle is checked from any of the three primary properties.
radio_spacing
P Spacing between the radio and the content.
scroll_on_select
P If the scrolls into view when the value selected.
select_on_init
P If value is selected when the widget that has the value is inited.
select_on_new
P If value selects the new value when the variable changes and the previous value was selected.
selector
P Sets the contextual selector that all inner widgets will target from the value property.
style_fn
P Extends or replaces the widget style.
switch_spacing
P Spacing between the switch and the content.
tristate
P Enables None as an input value.
value
P Values that is selected in the contextual selector.