Expand description
Progress indicator widget, styles and properties.
This widget displays task::Progress values that track the status of a running task.
use zng::prelude::*;
let p = var(task::Progress::indeterminate());
// on the view
let view = zng::progress::ProgressView!(p.clone());
// on the controller/view-model
task::spawn(async move {
for n in 0..=10 {
task::deadline(500.ms()).await;
p.set(task::Progress::from_n_of(n, 10).with_msg(formatx!("sleeping {n} of 10")));
}
p.set(task::Progress::complete().with_msg("done sleeping"));
});§Full API
See zng_wgt_progress and zng_task::Progress for the full widget API.
Structs§
- Circular
Style WCircular progress indicator style.- Default
Style WProgress view default style (progress bar with message text).- Progress
View WProgress indicator widget.- Simple
BarStyle WProgress view style that is only the progress bar, no message text.- Simple
Circular Style WCircular progress indicator style without message text.
Statics§
- PROGRESS_
VAR - The progress status value in a
ProgressView
Functions§
- circular_
style_ fn PExtends or replaces theCircularStyle!.- is_
indeterminate PGetter property that istruewhen progress is indeterminate.- on_
complete PEvent raised when progress updates to a complete state or inits completed.- on_
progress PEvent raised for each progress update, and once after info init.- simple_
bar_ style_ fn PExtends or replaces theSimpleBarStyle!.- simple_
circular_ style_ fn PExtends or replaces theSimpleCircularStyle!.