Files
signed/desktop/src/main.rs
T
2026-08-05 09:03:42 +07:00

46 lines
1.5 KiB
Rust

use std::sync::Arc;
use gpui::*;
use gpui_platform::application;
fn main() {
// Initialize logging
tracing_subscriber::fmt::init();
application()
.with_http_client(Arc::new(reqwest_client::ReqwestClient::new()))
.run(move |cx| {
gpui_component::init(cx);
// Initialize backend and stores (connects relays, restores session)
std::fs::create_dir_all(paths::nostr_dir()).ok();
signed_state::init(paths::nostr_dir(), cx);
// Set up the window bounds
let bounds = Bounds::centered(None, size(px(960.0), px(720.0)), cx);
// Set up the window options
let opts = WindowOptions {
window_background: WindowBackgroundAppearance::Opaque,
window_decorations: Some(WindowDecorations::Client),
window_bounds: Some(WindowBounds::Windowed(bounds)),
kind: WindowKind::Normal,
app_id: Some("Signed".to_owned()),
titlebar: Some(TitlebarOptions {
title: Some(SharedString::new_static("Signed Platform")),
traffic_light_position: Some(point(px(9.0), px(9.0))),
appears_transparent: true,
}),
..Default::default()
};
cx.spawn(async move |cx| {
let _ = cx.open_window(opts, workspace::root);
})
.detach();
// Bring the app to the foreground
cx.activate(true);
});
}