Components / display
StageProgress builder
A run of named stages, all of them supplied by the caller.
A builder is RenderOnce. Construct and mount it in one expression.
use gpui_kit::display::stage_progress::StageProgress;
Reviewed in stage-progress.
Construct
new(ident: impl Into<Ident>) -> Self
Options
Chain onto the value.
stages(stages: impl IntoIterator<Item = ProgressStage>) -> Self
Example · stage-progress
fn stage_progress(_window: &mut Window, cx: &mut App) -> AnyElement {
let theme = cx.theme().clone();
stack(&theme)
.w(px(420.0))
.child(caption(&theme, "Download, then verify, then install"))
.child(StageProgress::new("scene.stage.running").stages([
ProgressStage::new("download", "Download", StageStatus::Done),
ProgressStage::new("verify", "Verify", StageStatus::Active),
ProgressStage::new("install", "Install", StageStatus::Pending),
]))
.child(caption(&theme, "A stage that failed keeps its name"))
.child(StageProgress::new("scene.stage.failed").stages([
ProgressStage::new("download", "Download", StageStatus::Done),
ProgressStage::new("verify", "Verify", StageStatus::Failed),
ProgressStage::new("install", "Install", StageStatus::Pending),
]))
.into_any_element()
}