initial commit
This commit is contained in:
45
src/main.rs
Normal file
45
src/main.rs
Normal file
@@ -0,0 +1,45 @@
|
||||
use gpui::{bounds, point, prelude::*, px, size};
|
||||
|
||||
mod app;
|
||||
mod asset;
|
||||
mod colors;
|
||||
mod component;
|
||||
mod dashboard;
|
||||
mod query;
|
||||
mod theme;
|
||||
mod titlebar;
|
||||
mod api;
|
||||
|
||||
fn main() {
|
||||
gpui::Application::new()
|
||||
.with_assets(asset::Asset)
|
||||
.run(setup_application);
|
||||
}
|
||||
|
||||
fn setup_application(cx: &mut gpui::App) {
|
||||
let window_bounds = gpui::Bounds::centered(None, size(px(800.), px(600.0)), cx);
|
||||
|
||||
let global = app::Global {
|
||||
safe_area: bounds(point(px(0.), px(0.)), size(px(72.), px(12.))),
|
||||
current_theme: cx.window_appearance().into(),
|
||||
query_store: query::Store::new(),
|
||||
};
|
||||
|
||||
let top_left = global.safe_area.origin;
|
||||
|
||||
cx.set_global(global);
|
||||
|
||||
cx.open_window(
|
||||
gpui::WindowOptions {
|
||||
window_bounds: Some(gpui::WindowBounds::Windowed(window_bounds)),
|
||||
titlebar: Some(gpui::TitlebarOptions {
|
||||
appears_transparent: true,
|
||||
traffic_light_position: Some(top_left + point(px(8.), px(8.))),
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
|window, cx| cx.new(|cx| app::Chrome::new(window, cx)),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user