Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Sep 6, 2023
1 parent 7981a0a commit 3dd5dfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/views/container_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ pub struct ContainerBox {
/// use floem_reactive::*;
/// let check = true;
///
/// container_box(|| {
/// if check == true {
/// Box::new(checkbox(create_rw_signal(true).read_only()))
/// } else {
/// Box::new(label(|| "no check".to_string()))
/// }
/// });
/// if check == true {
/// container_box(checkbox(create_rw_signal(true).read_only()))
/// } else {
/// container_box(label(|| "no check".to_string()))
/// };
/// ```
pub fn container_box(child: impl View + 'static) -> ContainerBox {
ContainerBox {
Expand Down
4 changes: 2 additions & 2 deletions src/views/decorator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait Decorators: View + Sized {
/// }
///
/// fn other() -> impl View {
/// stack(|| (
/// stack((
/// view(), // will be red and size 20
/// // will be green and default size due to the previous style being overwritten
/// view().style(|s| s.color(Color::GREEN)),
Expand Down Expand Up @@ -53,7 +53,7 @@ pub trait Decorators: View + Sized {
/// }
///
/// fn other() -> impl View {
/// stack(|| (
/// stack((
/// view(), // will be red and size 20
/// // will be green and size 20
/// view().style(|s| s.color(Color::GREEN)),
Expand Down

0 comments on commit 3dd5dfe

Please sign in to comment.