tab_bar.rs

 1use ui::prelude::*;
 2use ui::{Tab, TabBar};
 3
 4use crate::story::Story;
 5
 6#[derive(Element, Default)]
 7pub struct TabBarStory {}
 8
 9impl TabBarStory {
10    fn render<V: 'static>(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
11        Story::container(cx)
12            .child(Story::title_for::<_, TabBar<V>>(cx))
13            .child(Story::label(cx, "Default"))
14            .child(TabBar::new(vec![
15                Tab::new()
16                    .title("Cargo.toml".to_string())
17                    .current(false)
18                    .git_status(GitStatus::Modified),
19                Tab::new()
20                    .title("Channels Panel".to_string())
21                    .current(false),
22                Tab::new()
23                    .title("channels_panel.rs".to_string())
24                    .current(true)
25                    .git_status(GitStatus::Modified),
26                Tab::new()
27                    .title("workspace.rs".to_string())
28                    .current(false)
29                    .git_status(GitStatus::Modified),
30                Tab::new()
31                    .title("icon_button.rs".to_string())
32                    .current(false),
33                Tab::new()
34                    .title("storybook.rs".to_string())
35                    .current(false)
36                    .git_status(GitStatus::Created),
37                Tab::new().title("theme.rs".to_string()).current(false),
38                Tab::new()
39                    .title("theme_registry.rs".to_string())
40                    .current(false),
41                Tab::new()
42                    .title("styleable_helpers.rs".to_string())
43                    .current(false),
44            ]))
45    }
46}