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

65 lines
1.5 KiB
Rust
Raw Normal View History

2023-08-11 06:26:58 +00:00
#![allow(dead_code, unused_variables)]
2023-08-14 03:20:41 +00:00
use element::{AnyElement, Element};
use frame::frame;
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| {
2023-08-14 15:26:35 +00:00
cx.add_window(Default::default(), |_| {
view(|_| workspace(&rose_pine::moon()))
});
cx.platform().activate(true);
});
}
2023-08-14 03:20:41 +00:00
use themes::{rose_pine, ThemeColors};
2023-08-14 15:26:35 +00:00
use view::view;
2023-07-25 05:27:14 +00:00
2023-08-14 03:20:41 +00:00
mod adapter;
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;
2023-08-14 15:26:35 +00:00
mod view;
2023-08-11 06:26:58 +00:00
2023-08-14 03:20:41 +00:00
pub struct Playground<V: 'static>(AnyElement<V>);
2023-08-11 06:26:58 +00:00
2023-08-14 03:20:41 +00:00
impl<V> Playground<V> {
pub fn new() -> Self {
Self(workspace(&rose_pine::moon()).into_any())
2023-07-25 05:27:14 +00:00
}
}
2023-08-14 03:20:41 +00:00
fn workspace<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
frame()
}
2023-08-13 07:40:05 +00:00
// 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
// }