Follow the gpui 0.6 API and inherit the theme foreground
Browse files at this commit3c965a4106a9bf9bde7083755237be98ca5f5de2Parent: a052f57- fix
- follow the gpui 0.6 API and inherit the theme foreground
2 changed files +5 -7
crates/client/src/gui.rsmodified+2 -2
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | use common::user::User; |
| 2 | 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 | 4 | use tokio::sync::mpsc; |
| 5 | 5 | |
| 6 | 6 | use crate::{ |
| @@ -164,7 +164,7 @@ impl Render for Yumush { | ||
| 164 | 164 | .items_center() |
| 165 | 165 | .size_full() |
| 166 | 166 | .bg(rgb(0x1e1e1e)) |
| 167 | - .text_color(rgb(0xffffff)) | |
| 167 | + .text_color(cx.theme().foreground) | |
| 168 | 168 | .child(match self.current_route { |
| 169 | 169 | Route::Register => self.register_page(cx).into_any_element(), |
| 170 | 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}; | |
| 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}; | |
| 5 | 3 | use gpui_component::Root; |
| 6 | 4 | |
| 7 | 5 | fn main() { |
| @@ -9,7 +7,7 @@ fn main() { | ||
| 9 | 7 | |
| 10 | 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 | 11 | gpui_component::init(cx); |
| 14 | 12 | |
| 15 | 13 | let window_bounds = Bounds::centered(None, size(px(800.0), px(600.0)), cx); |