This is a dumb first pass at a standard text example. We'll use this to start digging in to some text/scale rendering issues. There will be a ton of follow-up features to this, but starting simple. Release Notes: - N/A
30 lines
794 B
Rust
30 lines
794 B
Rust
use gpui::{Entity, Render};
|
|
use story::{Story, StoryItem, StorySection};
|
|
|
|
use ui::prelude::*;
|
|
|
|
use crate::application_menu::ApplicationMenu;
|
|
|
|
pub struct ApplicationMenuStory {
|
|
menu: Entity<ApplicationMenu>,
|
|
}
|
|
|
|
impl ApplicationMenuStory {
|
|
pub fn new(window: &mut Window, cx: &mut App) -> Self {
|
|
Self {
|
|
menu: cx.new(|cx| ApplicationMenu::new(window, cx)),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Render for ApplicationMenuStory {
|
|
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
|
Story::container(cx)
|
|
.child(Story::title_for::<ApplicationMenu>(cx))
|
|
.child(StorySection::new().child(StoryItem::new(
|
|
"Application Menu",
|
|
h_flex().child(self.menu.clone()),
|
|
)))
|
|
}
|
|
}
|