migrate ui components to gpui-kit
This commit is contained in:
+7
-13
@@ -2,15 +2,14 @@ use std::sync::{Arc, Mutex};
|
||||
|
||||
use assets::Assets;
|
||||
use gpui::{
|
||||
App, AppContext, Bounds, KeyBinding, Menu, MenuItem, SharedString, TitlebarOptions,
|
||||
App, Bounds, KeyBinding, Menu, MenuItem, SharedString, TitlebarOptions,
|
||||
WindowBackgroundAppearance, WindowBounds, WindowDecorations, WindowKind, WindowOptions,
|
||||
actions, point, px, size,
|
||||
};
|
||||
use gpui_platform::application;
|
||||
use nostr_sdk::prelude::SecretKey;
|
||||
use state::{APP_ID, CLIENT_NAME};
|
||||
use theme::TABBAR_HEIGHT;
|
||||
use ui::Root;
|
||||
use ui::TABBAR_HEIGHT;
|
||||
|
||||
actions!(coop, [Quit]);
|
||||
|
||||
@@ -28,14 +27,11 @@ fn main() {
|
||||
|
||||
// Run application
|
||||
application()
|
||||
.with_assets(Assets)
|
||||
.with_assets(assets::CombinedAssets)
|
||||
.with_http_client(Arc::new(reqwest_client::ReqwestClient::new()))
|
||||
.run(move |cx| {
|
||||
// Initialize components
|
||||
ui::init(cx);
|
||||
|
||||
// Initialize theme
|
||||
theme::init(cx);
|
||||
// Initialize the framework before anything renders
|
||||
gpui_kit::init(cx);
|
||||
|
||||
// Load embedded fonts in assets/fonts
|
||||
load_embedded_fonts(cx);
|
||||
@@ -106,10 +102,8 @@ fn main() {
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
cx.open_window(opts, |window, cx| {
|
||||
cx.new(|cx| Root::new(workspace::init(window, cx).into(), window, cx))
|
||||
})
|
||||
.expect("Failed to open window. Please restart the application.");
|
||||
gpui_kit::open_window(opts, cx, workspace::init)
|
||||
.expect("Failed to open window. Please restart the application.");
|
||||
|
||||
cx.activate(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user