zed/crates/storybook2/src/storybook2.rs

56 lines
1.5 KiB
Rust
Raw Normal View History

2023-09-20 20:32:55 +00:00
#![allow(dead_code, unused_variables)]
2023-10-04 08:51:47 +00:00
use assets::Assets;
use gpui3::{px, size, Bounds, WindowBounds, WindowOptions};
2023-09-20 20:32:55 +00:00
use log::LevelFilter;
use simplelog::SimpleLogger;
2023-10-04 08:51:47 +00:00
use std::sync::Arc;
use workspace::workspace;
2023-09-20 20:32:55 +00:00
2023-10-04 08:51:47 +00:00
mod assets;
2023-09-20 20:32:55 +00:00
mod collab_panel;
mod theme;
2023-09-26 19:42:58 +00:00
mod themes;
mod ui;
2023-09-20 20:32:55 +00:00
mod workspace;
// gpui2::actions! {
// storybook,
// [ToggleInspector]
// }
fn main() {
2023-09-30 02:53:24 +00:00
// unsafe { backtrace_on_stack_overflow::enable() };
2023-09-20 20:32:55 +00:00
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
2023-10-04 08:51:47 +00:00
let asset_source = Arc::new(Assets);
gpui3::App::production(asset_source).run(|cx| {
2023-09-30 16:01:59 +00:00
let window = cx.open_window(
WindowOptions {
bounds: WindowBounds::Fixed(Bounds {
origin: Default::default(),
size: size(px(800.), px(600.)),
2023-09-30 16:01:59 +00:00
}),
..Default::default()
},
|cx| workspace(cx),
);
cx.activate(true);
});
2023-09-20 20:32:55 +00:00
}
// fn load_embedded_fonts(platform: &dyn gpui2::Platform) {
// let font_paths = Assets.list("fonts");
// let mut embedded_fonts = Vec::new();
// for font_path in &font_paths {
// if font_path.ends_with(".ttf") {
// let font_path = &*font_path;
// let font_bytes = Assets.load(font_path).unwrap().to_vec();
// embedded_fonts.push(Arc::from(font_bytes));
// }
// }
// platform.fonts().add_fonts(&embedded_fonts).unwrap();
// }