Skip to main content

sync_toggle_visuals

Function sync_toggle_visuals 

Source
pub fn sync_toggle_visuals(
    commands: Commands<'_, '_>,
    parents: Query<'_, '_, (&Toggleable, &Transform, Option<&KnobGeometry>)>,
    knobs: Query<'_, '_, (Entity, &ChildOf, &mut Style, &mut Visuals), (With<ToggleKnob>, Without<Toggleable>)>,
)
Expand description

Slide the ToggleKnob child of every <toggle> to the track end its Toggleable::checked state calls for, and size it from the laid-out track. The track fill itself belongs to sync_track_fill.