Skip to main content

sync_progress_fill

Function sync_progress_fill 

Source
pub fn sync_progress_fill(
    commands: Commands<'_, '_>,
    bars: Query<'_, '_, (&ProgressBar, &Transform, Option<&ProgressChunk>)>,
    fills: Query<'_, '_, (Entity, &ChildOf, &mut Style, &mut StyleOverrides), With<ProgressFill>>,
    parents: Query<'_, '_, &ChildOf>,
    visibles: Query<'_, '_, &Visible>,
    styles: Query<'_, '_, &Style, Without<ProgressFill>>,
    anim: Option<Res<'_, AnimationsActive>>,
    epoch: Local<'_, Option<Instant>>,
)
Expand description

Keep every .progress-fill child in step with its parent ProgressBar.

  • Determinate: width = value / max percent, pinned left.
  • Indeterminate: fixed 30 % width, inset.left bouncing across the remaining track width on ProgressBar::period_ms; requests an AnimationsActive follow-up tick while any such bar is visible so the sweep animates without input events. Hidden bars (closed tab, hidden dialog) stop requesting ticks - quiescence holds.