Add TrafficLights
component (#3011)
This PR adds a `TrafficLights` component for GPUI2. <img width="861" alt="Screenshot 2023-09-21 at 11 32 10 PM" src="https://github.com/zed-industries/zed/assets/1486634/0fe0e847-49b3-44dc-bd4c-64f12f0051c1"> Release Notes: - N/A
This commit is contained in:
parent
66358f2900
commit
5083ab7694
6 changed files with 70 additions and 29 deletions
|
@ -14,6 +14,7 @@ use log::LevelFilter;
|
|||
use settings::{default_settings, SettingsStore};
|
||||
use simplelog::SimpleLogger;
|
||||
use stories::components::facepile::FacepileStory;
|
||||
use stories::components::traffic_lights::TrafficLightsStory;
|
||||
use stories::elements::avatar::AvatarStory;
|
||||
use ui::{ElementExt, Theme};
|
||||
|
||||
|
@ -35,6 +36,7 @@ impl FromStr for Story {
|
|||
match s.to_ascii_lowercase().as_str() {
|
||||
"elements/avatar" => Ok(Self::Element(ElementStory::Avatar)),
|
||||
"components/facepile" => Ok(Self::Component(ComponentStory::Facepile)),
|
||||
"components/traffic_lights" => Ok(Self::Component(ComponentStory::TrafficLights)),
|
||||
_ => Err(anyhow!("story not found for '{s}'")),
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +50,7 @@ enum ElementStory {
|
|||
#[derive(Debug, Clone, Copy)]
|
||||
enum ComponentStory {
|
||||
Facepile,
|
||||
TrafficLights,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
|
@ -82,6 +85,9 @@ fn main() {
|
|||
Some(Story::Component(ComponentStory::Facepile)) => {
|
||||
view(|cx| render_story(&mut ViewContext::new(cx), FacepileStory::default()))
|
||||
}
|
||||
Some(Story::Component(ComponentStory::TrafficLights)) => view(|cx| {
|
||||
render_story(&mut ViewContext::new(cx), TrafficLightsStory::default())
|
||||
}),
|
||||
None => {
|
||||
view(|cx| render_story(&mut ViewContext::new(cx), WorkspaceElement::default()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue