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. - Progress
Bar - A progress bar.
- Progress
Tokens - The installed kit’s progress values, for a widget drawing progress of
its own (read from
progress-bar,progress-fill,progress-lineandprogress-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::delayedshows it only aftermotion.spinner.delay, and keeps itmotion.spinner.min.
Enums§
- BarSize
- How thick a bar is.
Functions§
- paint_
ring - Paints a ring in
rect: an arc from the top forfraction, a turning arc when none (still under reduced motion), the arc incoloroverprogress-ring’s track. For a ring that is part of another widget;Ringis the widget. - paint_
ring_ on paint_ringwith a painter of its own (another layer, a clip).- paint_
spinner - Paints a spinner’s arc in
rect, incoloroverspinner’s track. - paint_
spinner_ on paint_spinnerwith a painter of its own (another layer, a clip).