Use the editor_background color for the welcome screen's background (#3910)

This PR updates the welcome screen to use the same background color as
the editor.

<img width="1136" alt="Screenshot 2024-01-05 at 11 28 19 AM"
src="https://github.com/zed-industries/zed/assets/1486634/30f2bd7b-e25f-4851-9f43-eb187d1d62e6">

Release Notes:

- Updated the background color of the welcome screen to match the editor
background.
This commit is contained in:
Marshall Bowers 2024-01-05 11:34:32 -05:00 committed by GitHub
parent a205b2dbf3
commit 0083ca38e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,11 @@ pub struct WelcomePage {
impl Render for WelcomePage { impl Render for WelcomePage {
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement { fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
h_stack().full().track_focus(&self.focus_handle).child( h_stack()
.full()
.bg(cx.theme().colors().editor_background)
.track_focus(&self.focus_handle)
.child(
v_stack() v_stack()
.w_96() .w_96()
.gap_4() .gap_4()
@ -115,9 +119,9 @@ impl Render for WelcomePage {
.full_width() .full_width()
.on_click(cx.listener(|_, _, cx| { .on_click(cx.listener(|_, _, cx| {
cx.app_mut() cx.app_mut()
.spawn( .spawn(|cx| async move {
|cx| async move { install_cli::install_cli(&cx).await }, install_cli::install_cli(&cx).await
) })
.detach_and_log_err(cx); .detach_and_log_err(cx);
})), })),
), ),
@ -142,15 +146,15 @@ impl Render for WelcomePage {
ui::Selection::Unselected ui::Selection::Unselected
}, },
) )
.on_click(cx.listener( .on_click(
move |this, selection, cx| { cx.listener(move |this, selection, cx| {
this.update_settings::<VimModeSetting>( this.update_settings::<VimModeSetting>(
selection, selection,
cx, cx,
|setting, value| *setting = Some(value), |setting, value| *setting = Some(value),
); );
}, }),
)), ),
) )
.child(Label::new("Enable vim mode")), .child(Label::new("Enable vim mode")),
) )
@ -166,15 +170,17 @@ impl Render for WelcomePage {
ui::Selection::Unselected ui::Selection::Unselected
}, },
) )
.on_click(cx.listener( .on_click(
move |this, selection, cx| { cx.listener(move |this, selection, cx| {
this.update_settings::<TelemetrySettings>( this.update_settings::<TelemetrySettings>(
selection, selection,
cx, cx,
|settings, value| settings.metrics = Some(value), |settings, value| {
); settings.metrics = Some(value)
}, },
)), );
}),
),
) )
.child(Label::new("Send anonymous usage data")), .child(Label::new("Send anonymous usage data")),
) )
@ -190,8 +196,8 @@ impl Render for WelcomePage {
ui::Selection::Unselected ui::Selection::Unselected
}, },
) )
.on_click(cx.listener( .on_click(
move |this, selection, cx| { cx.listener(move |this, selection, cx| {
this.update_settings::<TelemetrySettings>( this.update_settings::<TelemetrySettings>(
selection, selection,
cx, cx,
@ -199,8 +205,8 @@ impl Render for WelcomePage {
settings.diagnostics = Some(value) settings.diagnostics = Some(value)
}, },
); );
}, }),
)), ),
) )
.child(Label::new("Send crash reports")), .child(Label::new("Send crash reports")),
), ),