use gpui::{bounds, point, prelude::*, px, size}; mod api; mod app; mod asset; mod colors; mod component; mod dashboard; mod query; mod theme; mod titlebar; 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 query_store = query::Store::new( api::QueryContext { http: reqwest::Client::new(), auth: None, }, cx, ); let global = app::Global { safe_area: bounds(point(px(0.), px(0.)), size(px(72.), px(12.))), current_theme: cx.window_appearance().into(), }; let top_left = global.safe_area.origin; cx.set_global(global); cx.set_global(query_store); 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(12.), px(12.))), ..Default::default() }), ..Default::default() }, |window, cx| cx.new(|cx| app::Chrome::new(window, cx)), ) .unwrap(); }