ZIm/crates/ui/src/components/stories/platform_titlebar.rs
Marshall Bowers 123d3ee282
ui: Clean up PlatformTitlebar implementation (#9413)
This PR cleans up the implementation of the `PlatformTitlebar` component
to better match our conventions for building UI components.

Release Notes:

- N/A
2024-03-15 14:31:02 -04:00

46 lines
1.4 KiB
Rust

use gpui::Render;
use story::{StoryContainer, StoryItem, StorySection};
use crate::{prelude::*, PlatformStyle, PlatformTitlebar};
pub struct PlatformTitlebarStory;
impl Render for PlatformTitlebarStory {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
StoryContainer::new(
"Platform Titlebar",
"crates/ui/src/components/stories/platform_titlebar.rs",
)
.child(
StorySection::new().child(
StoryItem::new(
"Default (macOS)",
PlatformTitlebar::new("macos").platform_style(PlatformStyle::MacOs),
)
.description("")
.usage(""),
),
)
.child(
StorySection::new().child(
StoryItem::new(
"Default (Linux)",
PlatformTitlebar::new("linux").platform_style(PlatformStyle::Linux),
)
.description("")
.usage(""),
),
)
.child(
StorySection::new().child(
StoryItem::new(
"Default (Windows)",
PlatformTitlebar::new("windows").platform_style(PlatformStyle::Windows),
)
.description("")
.usage(""),
),
)
.into_element()
}
}