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,153 +59,159 @@ 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()
v_stack() .full()
.w_96() .bg(cx.theme().colors().editor_background)
.gap_4() .track_focus(&self.focus_handle)
.mx_auto() .child(
.child( v_stack()
svg() .w_96()
.path("icons/logo_96.svg") .gap_4()
.text_color(gpui::white()) .mx_auto()
.w(px(96.)) .child(
.h(px(96.)) svg()
.mx_auto(), .path("icons/logo_96.svg")
) .text_color(gpui::white())
.child( .w(px(96.))
h_stack() .h(px(96.))
.justify_center() .mx_auto(),
.child(Label::new("Code at the speed of thought")), )
) .child(
.child( h_stack()
v_stack() .justify_center()
.gap_2() .child(Label::new("Code at the speed of thought")),
.child( )
Button::new("choose-theme", "Choose a theme") .child(
.full_width() v_stack()
.on_click(cx.listener(|this, _, cx| { .gap_2()
this.workspace .child(
.update(cx, |workspace, cx| { Button::new("choose-theme", "Choose a theme")
theme_selector::toggle( .full_width()
workspace, .on_click(cx.listener(|this, _, cx| {
&Default::default(), this.workspace
cx, .update(cx, |workspace, cx| {
) theme_selector::toggle(
}) workspace,
.ok(); &Default::default(),
})), cx,
) )
.child( })
Button::new("choose-keymap", "Choose a keymap") .ok();
.full_width() })),
.on_click(cx.listener(|this, _, cx| { )
this.workspace .child(
.update(cx, |workspace, cx| { Button::new("choose-keymap", "Choose a keymap")
base_keymap_picker::toggle( .full_width()
workspace, .on_click(cx.listener(|this, _, cx| {
&Default::default(), this.workspace
cx, .update(cx, |workspace, cx| {
) base_keymap_picker::toggle(
}) workspace,
.ok(); &Default::default(),
})), cx,
) )
.child( })
Button::new("install-cli", "Install the CLI") .ok();
.full_width() })),
.on_click(cx.listener(|_, _, cx| { )
cx.app_mut() .child(
.spawn( Button::new("install-cli", "Install the CLI")
|cx| async move { install_cli::install_cli(&cx).await }, .full_width()
.on_click(cx.listener(|_, _, cx| {
cx.app_mut()
.spawn(|cx| async move {
install_cli::install_cli(&cx).await
})
.detach_and_log_err(cx);
})),
),
)
.child(
v_stack()
.p_3()
.gap_2()
.bg(cx.theme().colors().elevated_surface_background)
.border_1()
.border_color(cx.theme().colors().border)
.rounded_md()
.child(
h_stack()
.gap_2()
.child(
Checkbox::new(
"enable-vim",
if VimModeSetting::get_global(cx).0 {
ui::Selection::Selected
} else {
ui::Selection::Unselected
},
) )
.detach_and_log_err(cx); .on_click(
})), cx.listener(move |this, selection, cx| {
), this.update_settings::<VimModeSetting>(
) selection,
.child( cx,
v_stack() |setting, value| *setting = Some(value),
.p_3() );
.gap_2() }),
.bg(cx.theme().colors().elevated_surface_background) ),
.border_1()
.border_color(cx.theme().colors().border)
.rounded_md()
.child(
h_stack()
.gap_2()
.child(
Checkbox::new(
"enable-vim",
if VimModeSetting::get_global(cx).0 {
ui::Selection::Selected
} else {
ui::Selection::Unselected
},
) )
.on_click(cx.listener( .child(Label::new("Enable vim mode")),
move |this, selection, cx| { )
this.update_settings::<VimModeSetting>( .child(
selection, h_stack()
cx, .gap_2()
|setting, value| *setting = Some(value), .child(
); Checkbox::new(
}, "enable-telemetry",
)), if TelemetrySettings::get_global(cx).metrics {
) ui::Selection::Selected
.child(Label::new("Enable vim mode")), } else {
) ui::Selection::Unselected
.child( },
h_stack() )
.gap_2() .on_click(
.child( cx.listener(move |this, selection, cx| {
Checkbox::new( this.update_settings::<TelemetrySettings>(
"enable-telemetry", selection,
if TelemetrySettings::get_global(cx).metrics { cx,
ui::Selection::Selected |settings, value| {
} else { settings.metrics = Some(value)
ui::Selection::Unselected },
}, );
}),
),
) )
.on_click(cx.listener( .child(Label::new("Send anonymous usage data")),
move |this, selection, cx| { )
this.update_settings::<TelemetrySettings>( .child(
selection, h_stack()
cx, .gap_2()
|settings, value| settings.metrics = Some(value), .child(
); Checkbox::new(
}, "enable-crash",
)), if TelemetrySettings::get_global(cx).diagnostics {
) ui::Selection::Selected
.child(Label::new("Send anonymous usage data")), } else {
) ui::Selection::Unselected
.child( },
h_stack() )
.gap_2() .on_click(
.child( cx.listener(move |this, selection, cx| {
Checkbox::new( this.update_settings::<TelemetrySettings>(
"enable-crash", selection,
if TelemetrySettings::get_global(cx).diagnostics { cx,
ui::Selection::Selected |settings, value| {
} else { settings.diagnostics = Some(value)
ui::Selection::Unselected },
}, );
}),
),
) )
.on_click(cx.listener( .child(Label::new("Send crash reports")),
move |this, selection, cx| { ),
this.update_settings::<TelemetrySettings>( ),
selection, )
cx,
|settings, value| {
settings.diagnostics = Some(value)
},
);
},
)),
)
.child(Label::new("Send crash reports")),
),
),
)
} }
} }