dialog
Builds Dialog


The code that drew it
A still frame holds a repeating animation at its first frame and a one-shot at its last, because a still of a moving thing is not reproducible. Run the gallery to review motion.
fn dialog(window: &mut Window, cx: &mut App) -> AnyElement {
if !cx.has_global::<SceneDialog>() {
let replace = cx.new(|cx| {
Dialog::new("scene.dialog.replace", window, cx)
.title("Replace the existing theme?")
.description(
"The application owns this decision. The dialog presents it and reports what \
was chosen.",
)
.cancel_label("Cancel")
.confirm_label("Replace")
});
replace.update(cx, |dialog, cx| dialog.open(window, cx));
cx.set_global(SceneDialog { replace });
}
let replace = cx.global::<SceneDialog>().replace.clone();
let theme = cx.theme().clone();
stack(&theme)
.w(px(560.0))
.h(px(360.0))
.child(div().child("Content behind the dialog"))
.child(replace)
.into_any_element()
}