Add story for ApplicationMenu
(#13948)
This PR adds a story for the `ApplicationMenu` so it can be viewed in isolation. <img width="664" alt="Screenshot 2024-07-08 at 4 45 24 PM" src="https://github.com/zed-industries/zed/assets/1486634/dca3dd32-4845-4009-b781-b4bac9ba6049"> Release Notes: - N/A
This commit is contained in:
parent
ea9ba6863d
commit
1a0242eff7
7 changed files with 34 additions and 58 deletions
|
@ -33,6 +33,7 @@ simplelog = "0.9"
|
|||
story.workspace = true
|
||||
strum = { version = "0.25.0", features = ["derive"] }
|
||||
theme.workspace = true
|
||||
title_bar = { workspace = true, features = ["stories"] }
|
||||
ui = { workspace = true, features = ["stories"] }
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -12,6 +12,7 @@ use ui::prelude::*;
|
|||
#[derive(Debug, PartialEq, Eq, Clone, Copy, strum::Display, EnumString, EnumIter)]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum ComponentStory {
|
||||
ApplicationMenu,
|
||||
AutoHeightEditor,
|
||||
Avatar,
|
||||
Button,
|
||||
|
@ -35,7 +36,6 @@ pub enum ComponentStory {
|
|||
Tab,
|
||||
TabBar,
|
||||
Text,
|
||||
// TitleBar,
|
||||
ToggleButton,
|
||||
ToolStrip,
|
||||
ViewportUnits,
|
||||
|
@ -45,6 +45,7 @@ pub enum ComponentStory {
|
|||
impl ComponentStory {
|
||||
pub fn story(&self, cx: &mut WindowContext) -> AnyView {
|
||||
match self {
|
||||
Self::ApplicationMenu => cx.new_view(|_| title_bar::ApplicationMenuStory).into(),
|
||||
Self::AutoHeightEditor => AutoHeightEditorStory::new(cx).into(),
|
||||
Self::Avatar => cx.new_view(|_| ui::AvatarStory).into(),
|
||||
Self::Button => cx.new_view(|_| ui::ButtonStory).into(),
|
||||
|
@ -69,7 +70,6 @@ impl ComponentStory {
|
|||
Self::Text => TextStory::view(cx).into(),
|
||||
Self::Tab => cx.new_view(|_| ui::TabStory).into(),
|
||||
Self::TabBar => cx.new_view(|_| ui::TabBarStory).into(),
|
||||
// Self::TitleBar => cx.new_view(|_| title_bar::TitleBarStory).into(),
|
||||
Self::ToggleButton => cx.new_view(|_| ui::ToggleButtonStory).into(),
|
||||
Self::ToolStrip => cx.new_view(|_| ui::ToolStripStory).into(),
|
||||
Self::ViewportUnits => cx.new_view(|_| crate::stories::ViewportUnitsStory).into(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue