use std::marker::PhantomData; use ui::prelude::*; use ui::{hello_world_rust_buffer_example, MultiBuffer}; use crate::story::Story; #[derive(Element)] pub struct MultiBufferStory { state_type: PhantomData, } impl MultiBufferStory { pub fn new() -> Self { Self { state_type: PhantomData, } } fn render(&mut self, cx: &mut ViewContext) -> impl Element { let theme = theme(cx); Story::container(cx) .child(Story::title_for::<_, MultiBuffer>(cx)) .child(Story::label(cx, "Default")) .child(MultiBuffer::new(vec![ hello_world_rust_buffer_example(&theme), hello_world_rust_buffer_example(&theme), hello_world_rust_buffer_example(&theme), hello_world_rust_buffer_example(&theme), hello_world_rust_buffer_example(&theme), ])) } }