diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index 4c5770c..dfbcabf 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -8,6 +8,4 @@ common = { workspace = true, features = ["client"] } tokio.workspace = true quinn = { workspace = true, features = ["rustls-ring", "platform-verifier"] } -gpui = { package = "gpui-pre", version = "0.3.6" } -gpui-platform = { package = "gpui-pre-platform", version = "0.3.6", features = ["x11", "wayland"]} -gpui-component = "0.6.6" +gpui-kit = "0.6.6" diff --git a/crates/client/src/event.rs b/crates/client/src/event.rs index 721833c..334cc01 100644 --- a/crates/client/src/event.rs +++ b/crates/client/src/event.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use gpui::{Context, Window}; +use gpui_kit::{Context, Window}; use crate::gui::Yumush; diff --git a/crates/client/src/gui.rs b/crates/client/src/gui.rs index 566b921..95b3081 100644 --- a/crates/client/src/gui.rs +++ b/crates/client/src/gui.rs @@ -1,6 +1,9 @@ use common::user::User; -use gpui::{IntoElement, ParentElement, Render, Styled, div, rgb}; -use gpui_component::{ActiveTheme, Root, WindowExt, button::Button, notification::Notification}; +use gpui_kit::{ + Context, IntoElement, ParentElement, Render, Styled, Window, + component::{ActiveTheme, Root, WindowExt, button::Button, notification::Notification}, + div, rgb, +}; use tokio::sync::mpsc; use crate::{ @@ -32,8 +35,8 @@ impl Yumush { pub fn new( network: NetworkHandle, mut network_event_receiver: mpsc::Receiver, - window: &mut gpui::Window, - cx: &mut gpui::Context, + window: &mut Window, + cx: &mut Context, ) -> Self { cx.spawn_in(window, async move |this, cx| { while let Some(event) = network_event_receiver.recv().await { @@ -83,7 +86,7 @@ impl Yumush { self.user.as_ref().map(|user| user.get_username()) } - fn logout(&mut self, window: &mut gpui::Window, cx: &mut gpui::Context) { + fn logout(&mut self, window: &mut Window, cx: &mut Context) { let Some(user) = self.get_user() else { return; }; @@ -103,12 +106,7 @@ impl Yumush { .detach(); } - fn change_page( - &mut self, - new_route: Route, - window: &mut gpui::Window, - cx: &mut gpui::Context, - ) { + fn change_page(&mut self, new_route: Route, window: &mut Window, cx: &mut Context) { self.current_route = new_route; cx.notify(); @@ -122,8 +120,8 @@ impl Yumush { fn handle_network_event( &mut self, event: NetworkEvent, - window: &mut gpui::Window, - cx: &mut gpui::Context, + window: &mut Window, + cx: &mut Context, ) { match event { NetworkEvent::Connected(user) => { @@ -148,11 +146,7 @@ impl Yumush { } impl Render for Yumush { - fn render( - &mut self, - window: &mut gpui::Window, - cx: &mut gpui::Context, - ) -> impl gpui::IntoElement { + fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { div() .size_full() .relative() diff --git a/crates/client/src/gui/chat.rs b/crates/client/src/gui/chat.rs index 9a6b1f2..abb29f4 100644 --- a/crates/client/src/gui/chat.rs +++ b/crates/client/src/gui/chat.rs @@ -5,15 +5,16 @@ use common::{ user::User, validate::{validate_community_name, validate_message_body}, }; -use gpui::{ +use gpui_kit::{ AppContext, Context, Entity, FontWeight, InteractiveElement, IntoElement, ParentElement, - StatefulInteractiveElement, Styled, Window, div, rgb, -}; -use gpui_component::{ - WindowExt, - button::Button, - input::{Input, InputEvent, InputState}, - notification::Notification, + StatefulInteractiveElement, Styled, Window, + component::{ + WindowExt, + button::Button, + input::{Input, InputEvent, InputState}, + notification::Notification, + }, + div, rgb, }; use crate::gui::Yumush; diff --git a/crates/client/src/gui/login.rs b/crates/client/src/gui/login.rs index ab45b88..b5a5607 100644 --- a/crates/client/src/gui/login.rs +++ b/crates/client/src/gui/login.rs @@ -1,9 +1,12 @@ -use gpui::{AppContext, Context, Entity, IntoElement, ParentElement, Styled, Window, div}; -use gpui_component::{ - WindowExt, - button::Button, - input::{Input, InputEvent, InputState}, - notification::Notification, +use gpui_kit::{ + AppContext, Context, Entity, IntoElement, ParentElement, Styled, Window, + component::{ + WindowExt, + button::Button, + input::{Input, InputEvent, InputState}, + notification::Notification, + }, + div, }; use crate::gui::{Route, Yumush}; diff --git a/crates/client/src/gui/register.rs b/crates/client/src/gui/register.rs index 05a75bb..349116e 100644 --- a/crates/client/src/gui/register.rs +++ b/crates/client/src/gui/register.rs @@ -1,9 +1,12 @@ -use gpui::{AppContext, Context, Entity, IntoElement, ParentElement, Styled, Window, div}; -use gpui_component::{ - WindowExt, - button::Button, - input::{Input, InputEvent, InputState}, - notification::Notification, +use gpui_kit::{ + AppContext, Context, Entity, IntoElement, ParentElement, Styled, Window, + component::{ + WindowExt, + button::Button, + input::{Input, InputEvent, InputState}, + notification::Notification, + }, + div, }; use crate::gui::{Route, Yumush}; diff --git a/crates/client/src/main.rs b/crates/client/src/main.rs index 6b821c6..03e6aeb 100644 --- a/crates/client/src/main.rs +++ b/crates/client/src/main.rs @@ -1,14 +1,16 @@ use client::{gui::Yumush, network, ClientConfig, NAME}; -use gpui::{px, size, App, AppContext, Bounds, TitlebarOptions, WindowBounds, WindowOptions}; -use gpui_component::Root; +use gpui_kit::{ + application, component::Root, init, px, size, App, AppContext, Bounds, TitlebarOptions, + WindowBounds, WindowOptions, +}; fn main() { println!("Hello, world!"); let (network_handle, network_event_receiver) = network::start(ClientConfig::default()); - gpui_platform::application().run(|cx: &mut App| { - gpui_component::init(cx); + application().run(|cx: &mut App| { + init(cx); let window_bounds = Bounds::centered(None, size(px(800.0), px(600.0)), cx);