pub fn sync_checkbox_visuals(
commands: Commands<'_, '_>,
parents_q: Query<'_, '_, (&Toggleable, Option<&Indeterminate>, &CheckboxStyle)>,
boxes: Query<'_, '_, (Entity, &ChildOf, &mut Visuals, &mut StyleOverrides, Option<&mut TextContent>), With<CheckboxBox>>,
)Expand description
Keep every .checkbox-box child in step with its parent state:
- fill:
checked_bgwhile checked OR indeterminate, the box’s own fill otherwise; - mark glyph:
MARK_CHECKEDchecked,MARK_INDETERMINATEindeterminate, empty otherwise.
Runs every tick (marker components move without a single Changed filter to hang off); writes only on actual diffs so change detection stays quiet on idle frames.