Skip to main content

Module switch

Module switch 

Source
Expand description

Switch / toggle widget.

Boolean on/off with a sliding knob; see switch.rs. Switch (toggle) widget — a boolean on/off control rendered as a rounded, pill-shaped “track” with a sliding circular “knob”. A near-clone of crate::widgets::check_box::CheckBox (boolean state + an on_toggle callback) restyled as a switch: toggling flips the knob’s horizontal position (via margin-left) and the track’s background colour.

Key types: [Switch], [SwitchState], [SwitchOnToggle].

Structs§

Switch
A toggleable on/off switch widget with a sliding knob and toggle callback.
SwitchOnToggle
SwitchOnToggleCallback
SwitchState
The on/off state of a Switch.
SwitchStateWrapper

Enums§

OptionSwitchOnToggle

Statics§

SWITCH_ON_TOGGLE_INVOKER
Process-global slot for this callback kind’s host-side invoker.

Functions§

AzApp_setSwitchOnToggleCallbackInvoker
Register the host-side invoker for this callback kind.
AzSwitchOnToggleCallback_createFromHostHandle
C-ABI export wrapping <Wrapper>::create_from_host_handle.

Type Aliases§

AzSwitchOnToggleCallbackInvoker
Pointer-arg variant of this callback kind’s typedef.
SwitchOnToggleCallbackType
Callback function type invoked when the switch is toggled.