Files
novem/src/main.rs

69 lines
1.8 KiB
Rust
Raw Normal View History

2026-04-20 15:13:26 +01:00
use gpui::{bounds, point, prelude::*, px, size};
2026-04-22 22:12:39 +01:00
use crate::screen::setup_wizard;
2026-04-22 12:41:33 +01:00
2026-04-21 11:50:04 +01:00
mod api;
2026-04-20 15:13:26 +01:00
mod app;
mod asset;
mod colors;
mod component;
mod dashboard;
mod query;
2026-04-21 20:30:41 +01:00
mod screen;
2026-04-20 15:13:26 +01:00
mod theme;
mod titlebar;
fn main() {
2026-04-22 12:41:33 +01:00
// 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();
2026-04-20 15:13:26 +01:00
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);
2026-04-21 11:50:04 +01:00
let query_store = query::Store::new(
api::QueryContext {
http: reqwest::Client::new(),
auth: None,
2026-04-21 20:30:41 +01:00
github: api::GithubCredentials {
client_id: "Iv23liZD4bMQpGJICsR7",
},
2026-04-21 11:50:04 +01:00
},
cx,
);
2026-04-20 15:13:26 +01:00
let global = app::Global {
safe_area: bounds(point(px(0.), px(0.)), size(px(72.), px(12.))),
current_theme: cx.window_appearance().into(),
2026-04-23 11:18:43 +01:00
rng: rand::rng(),
2026-04-20 15:13:26 +01:00
};
let top_left = global.safe_area.origin;
cx.set_global(global);
2026-04-21 11:50:04 +01:00
cx.set_global(query_store);
2026-04-20 15:13:26 +01:00
cx.open_window(
gpui::WindowOptions {
window_bounds: Some(gpui::WindowBounds::Windowed(window_bounds)),
titlebar: Some(gpui::TitlebarOptions {
appears_transparent: true,
2026-04-21 11:50:04 +01:00
traffic_light_position: Some(top_left + point(px(12.), px(12.))),
2026-04-20 15:13:26 +01:00
..Default::default()
}),
2026-04-22 12:41:33 +01:00
is_resizable: false,
2026-04-20 15:13:26 +01:00
..Default::default()
},
2026-04-23 11:18:43 +01:00
|window, cx| cx.new(|cx| setup_wizard::new(window, cx)),
2026-04-20 15:13:26 +01:00
)
.unwrap();
}