Split playground into gpui2 and storybook

This commit is contained in:
Nathan Sobo 2023-08-30 16:12:14 -06:00
parent ee11be98e5
commit 3b5ee59273
41 changed files with 175 additions and 2210 deletions

View file

@ -1,36 +1,22 @@
#![allow(dead_code, unused_variables)]
use gpui::{serde_json, ViewContext};
use theme::ThemeSettings;
use themes::Theme;
pub mod adapter;
pub mod color;
pub mod element;
pub mod elements;
pub mod interactive;
pub mod layout_context;
pub mod paint_context;
pub mod style;
pub mod view;
mod adapter;
mod color;
mod components;
mod div;
mod element;
mod hoverable;
mod interactive;
mod layout_context;
mod paint_context;
mod pressable;
mod style;
mod text;
mod themes;
mod view;
// Nathan: During the transition, we will include the base theme on the legacy Theme struct.
fn current_theme<V: 'static>(cx: &mut ViewContext<V>) -> Theme {
settings::get::<ThemeSettings>(cx)
.theme
.deserialized_base_theme
.lock()
.get_or_insert_with(|| {
let theme: Theme =
serde_json::from_value(settings::get::<ThemeSettings>(cx).theme.base_theme.clone())
.unwrap();
Box::new(theme)
})
.downcast_ref::<Theme>()
.unwrap()
.clone()
}
pub use color::*;
pub use element::{AnyElement, Element, IntoElement, Layout, ParentElement};
pub use geometry::{
rect::RectF,
vector::{vec2f, Vector2F},
};
pub use gpui::*;
pub use gpui2_macros::{Element, *};
pub use interactive::*;
pub use layout_context::LayoutContext;
pub use platform::{WindowBounds, WindowOptions};
pub use view::*;