forge
Explore
Log in

Don't you dare go Hollow

Follow the gpui 0.6 API and inherit the theme foreground

Browse files at this commit

3c965a4106a9bf9bde7083755237be98ca5f5de2Ahmet Kaan GümüşParent: a052f57
  • fix
    • follow the gpui 0.6 API and inherit the theme foreground
Show full message
🐛 fix(client): follow the gpui 0.6 API and inherit the theme foreground

Application::new() is gone in 0.3; the platform constructor is
gpui_platform::application(). The container no longer forces a white text
color, which used to cascade into Input and render typed text white on the
light-theme input background.
crates/client/src/gui.rsmodified+2 -2
@@ -1,6 +1,6 @@
1 use common::user::User;1 use common::user::User;
2 use gpui::{IntoElement, ParentElement, Render, Styled, div, rgb};2 use gpui::{IntoElement, ParentElement, Render, Styled, div, rgb};
3-use gpui_component::{Root, WindowExt, button::Button, notification::Notification};3+use gpui_component::{ActiveTheme, Root, WindowExt, button::Button, notification::Notification};
4 use tokio::sync::mpsc;4 use tokio::sync::mpsc;
5 5
6 use crate::{6 use crate::{
@@ -164,7 +164,7 @@ impl Render for Yumush {
164 .items_center()164 .items_center()
165 .size_full()165 .size_full()
166 .bg(rgb(0x1e1e1e))166 .bg(rgb(0x1e1e1e))
167- .text_color(rgb(0xffffff))167+ .text_color(cx.theme().foreground)
168 .child(match self.current_route {168 .child(match self.current_route {
169 Route::Register => self.register_page(cx).into_any_element(),169 Route::Register => self.register_page(cx).into_any_element(),
170 Route::Login => self.login_page(cx).into_any_element(),170 Route::Login => self.login_page(cx).into_any_element(),
crates/client/src/main.rsmodified+3 -5
@@ -1,7 +1,5 @@
1-use client::{ClientConfig, NAME, gui::Yumush, network};1+use client::{gui::Yumush, network, ClientConfig, NAME};
2-use gpui::{2+use gpui::{px, size, App, AppContext, Bounds, TitlebarOptions, WindowBounds, WindowOptions};
3- App, AppContext, Application, Bounds, TitlebarOptions, WindowBounds, WindowOptions, px, size,
4-};
5 use gpui_component::Root;3 use gpui_component::Root;
6 4
7 fn main() {5 fn main() {
@@ -9,7 +7,7 @@ fn main() {
9 7
10 let (network_handle, network_event_receiver) = network::start(ClientConfig::default());8 let (network_handle, network_event_receiver) = network::start(ClientConfig::default());
11 9
12- Application::new().run(|cx: &mut App| {10+ gpui_platform::application().run(|cx: &mut App| {
13 gpui_component::init(cx);11 gpui_component::init(cx);
14 12
15 let window_bounds = Bounds::centered(None, size(px(800.0), px(600.0)), cx);13 let window_bounds = Bounds::centered(None, size(px(800.0), px(600.0)), cx);