zed/crates/gpui/playground/src/playground.rs

75 lines
1.8 KiB
Rust
Raw Normal View History

2023-08-11 06:26:58 +00:00
#![allow(dead_code, unused_variables)]
2023-08-13 07:40:05 +00:00
use gpui::{elements::Empty, Element};
use log::LevelFilter;
use simplelog::SimpleLogger;
fn main() {
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
gpui::App::new(()).unwrap().run(|cx| {
cx.platform().activate(true);
2023-08-13 07:40:05 +00:00
// cx.add_window(
// WindowOptions {
// titlebar: Some(TitlebarOptions {
// appears_transparent: true,
// ..Default::default()
// }),
// ..Default::default()
// },
// |_| view(|_| Playground::new()),
// );
});
}
2023-08-13 07:40:05 +00:00
use std::marker::PhantomData;
use themes::ThemeColors;
2023-07-25 05:27:14 +00:00
2023-08-11 06:26:58 +00:00
mod color;
2023-08-14 01:47:49 +00:00
mod element;
2023-08-11 06:26:58 +00:00
mod frame;
2023-08-13 23:29:07 +00:00
mod style;
2023-08-11 06:26:58 +00:00
mod themes;
mod tokens;
#[derive(Element, Clone)]
pub struct Playground<V: 'static>(PhantomData<V>);
impl<V> Playground<V> {
pub fn new() -> Self {
Self(PhantomData)
}
2023-07-25 05:27:14 +00:00
2023-08-11 06:26:58 +00:00
pub fn render(&mut self, _: &mut V, _: &mut gpui::ViewContext<V>) -> impl Element<V> {
2023-08-13 07:40:05 +00:00
Empty::new()
// workspace(&rose_pine::dawn())
2023-07-25 05:27:14 +00:00
}
}
2023-08-13 07:40:05 +00:00
// fn workspace<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
// todo!()
// // column()
// // .size(auto())
// // .fill(theme.base(0.5))
// // .text_color(theme.text(0.5))
// // .child(title_bar(theme))
// // .child(stage(theme))
// // .child(status_bar(theme))
// }
2023-08-12 07:11:12 +00:00
// fn title_bar<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
// row()
// .fill(theme.base(0.2))
// .justify(0.)
// .width(auto())
// .child(text("Zed Playground"))
2023-08-11 06:26:58 +00:00
// }
2023-08-12 07:11:12 +00:00
// fn stage<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
// row().fill(theme.surface(0.9))
2023-08-11 06:26:58 +00:00
// }
2023-08-12 07:11:12 +00:00
// fn status_bar<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
// row().fill(theme.surface(0.1))
2023-08-11 06:26:58 +00:00
// }