use gpui::{bounds, point, prelude::*, px, size}; use crate::screen::setup_wizard; mod api; mod app; mod asset; mod colors; mod component; mod dashboard; mod query; mod screen; mod storage; mod theme; mod titlebar; fn main() { // GPUI polls our async query futures, but reqwest relies on Tokio's // reactor and blocking pool for DNS, sockets, and timers. let runtime = tokio::runtime::Builder::new_multi_thread() .enable_all() .build() .expect("failed to build Tokio runtime"); let _runtime_guard = runtime.enter(); 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, github: api::GithubCredentials { base_url: "https://api.github.com", client_id: "Iv23liZD4bMQpGJICsR7", }, }); let global = app::Global { safe_area: bounds(point(px(0.), px(0.)), size(px(72.), px(12.))), current_theme: cx.window_appearance().into(), rng: rand::rng(), }; 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() }), is_resizable: false, ..Default::default() }, |window, cx| cx.new(|cx| setup_wizard::new(window, cx)), ) .unwrap(); }