From 724d168a86dfd07383fbe95b25be33b3c76b499e Mon Sep 17 00:00:00 2001 From: viktorstrate Date: Fri, 22 Nov 2024 18:59:45 +0100 Subject: [PATCH] Fix doctest for zstack --- xilem/src/view/zstack.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xilem/src/view/zstack.rs b/xilem/src/view/zstack.rs index a6ba23362..edc9faf8a 100644 --- a/xilem/src/view/zstack.rs +++ b/xilem/src/view/zstack.rs @@ -18,13 +18,18 @@ use masonry::{ /// /// # Example /// -/// This example shows how to add a text label on top of an image. +/// This example shows how to add two text labels on top of each other. /// /// ``` -/// zstack(( -/// image(some_image), -/// label("Overlay text") -/// )) +/// use xilem::WidgetView; +/// use xilem::view::{zstack, label}; +/// +/// fn view() -> impl WidgetView<()> { +/// zstack::<(), (), _>(( +/// label("Background"), +/// label("Foreground") +/// )) +/// } /// ``` pub fn zstack>(sequence: Seq) -> ZStack { ZStack {