Skip to main content

Module progress

Module progress 

Source
Expand description

Progress and waiting: a bar (determinate or indeterminate, with tones and stacked sections), a ring, a meter and a spinner with a label and a delay, drawn by the kit (progress-bar, progress-line, progress-fill, progress-caption, meter, meter-tick, progress-ring, spinner; docs/kit.md) on the motion clock (motion): frozen in tests, still under reduced motion.

Experimental: may change in any release (docs/stability.md).

Each is an AccessKit ProgressIndicator (the meter a Meter) with a name, and, when determinate, a numeric value and its range (0 to the total, or 0 to 100) and a value text (“12 of 340”); an indeterminate one has no value.

use egui_pop_core::progress::{ProgressBar, Ring, Spinner, Tone};

fn ui(ui: &mut egui::Ui) {
    ui.add(ProgressBar::new(Some(0.42)).label("Export"));
    ui.add(
        ProgressBar::counts(340, 1204)
            .label("Import")
            .section(0.05, Tone::Danger, "failed")
            .text("340 of 1,204, 61 failed"),
    );
    ui.add(ProgressBar::new(None).label("Scanning"));
    ui.add(Ring::new(Some(0.75)).label("Render"));
    ui.add(Spinner::new().label("Loading previews"));
}

Re-exports§

pub use crate::kit::Tone;

Structs§

Meter
A value against thresholds (disk space, memory), not progress: a bar whose tone follows the highest threshold reached. AccessKit role Meter.
ProgressBar
A progress bar.
ProgressTokens
The installed kit’s progress values, for a widget drawing progress of its own (read from progress-bar, progress-fill, progress-line and progress-ring).
Ring
A small circular progress: determinate (an arc from the top) or indeterminate (a turning arc).
Section
A stacked section of a bar: done, failed, skipped.
Spinner
A spinner, with a label after it; Spinner::delayed shows it only after motion.spinner.delay, and keeps it motion.spinner.min.

Enums§

BarSize
How thick a bar is.

Functions§

paint_ring
Paints a ring in rect: an arc from the top for fraction, a turning arc when none (still under reduced motion), the arc in color over progress-ring’s track. For a ring that is part of another widget; Ring is the widget.
paint_ring_on
paint_ring with a painter of its own (another layer, a clip).
paint_spinner
Paints a spinner’s arc in rect, in color over spinner’s track.
paint_spinner_on
paint_spinner with a painter of its own (another layer, a clip).