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 @@
11 use common::user::User;
22 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};
44 use tokio::sync::mpsc;
55
66 use crate::{
@@ -164,7 +164,7 @@ impl Render for Yumush {
164164 .items_center()
165165 .size_full()
166166 .bg(rgb(0x1e1e1e))
167- .text_color(rgb(0xffffff))
167+ .text_color(cx.theme().foreground)
168168 .child(match self.current_route {
169169 Route::Register => self.register_page(cx).into_any_element(),
170170 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};
2-use gpui::{
3- App, AppContext, Application, Bounds, TitlebarOptions, WindowBounds, WindowOptions, px, size,
4-};
1+use client::{gui::Yumush, network, ClientConfig, NAME};
2+use gpui::{px, size, App, AppContext, Bounds, TitlebarOptions, WindowBounds, WindowOptions};
53 use gpui_component::Root;
64
75 fn main() {
@@ -9,7 +7,7 @@ fn main() {
97
108 let (network_handle, network_event_receiver) = network::start(ClientConfig::default());
119
12- Application::new().run(|cx: &mut App| {
10+ gpui_platform::application().run(|cx: &mut App| {
1311 gpui_component::init(cx);
1412
1513 let window_bounds = Bounds::centered(None, size(px(800.0), px(600.0)), cx);