Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Mikayla Makia0637a769ca0
diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rsindex 1deede76119..face85c4b6e 100644--- a/crates/welcome/src/welcome.rs+++ b/crates/welcome/src/welcome.rs@@ -1,15 +1,13 @@use gpui::{- actions,- elements::{Flex, Label, ParentElement},+ color::Color,+ elements::{Flex, Label, ParentElement, Svg},Element, Entity, MutableAppContext, View,};use settings::Settings;-use workspace::{item::Item, Workspace};--actions!(welcome, [ShowWelcome]);+use workspace::{item::Item, Welcome, Workspace};pub fn init(cx: &mut MutableAppContext) {- cx.add_action(|workspace: &mut Workspace, _: &ShowWelcome, cx| {+ cx.add_action(|workspace: &mut Workspace, _: &Welcome, cx| {let welcome_page = cx.add_view(|_cx| WelcomePage);workspace.add_item(Box::new(welcome_page), cx)})@@ -28,7 +26,29 @@ impl View for WelcomePage {fn render(&mut self, cx: &mut gpui::RenderContext<'_, Self>) -> gpui::ElementBox {let theme = &cx.global::<Settings>().theme;- Label::new("Welcome page", theme.editor.hover_popover.prose.clone()).boxed()++ Flex::new(gpui::Axis::Vertical)+ .with_children([+ Flex::new(gpui::Axis::Horizontal)+ .with_children([+ Svg::new("icons/terminal_16.svg")+ .with_color(Color::red())+ .constrained()+ .with_width(100.)+ .with_height(100.)+ .aligned()+ .contained()+ .boxed(),+ Label::new("Zed", theme.editor.hover_popover.prose.clone()).boxed(),+ ])+ .boxed(),+ Label::new(+ "Code at the speed of thought",+ theme.editor.hover_popover.prose.clone(),+ )+ .boxed(),+ ])+ .boxed()}}diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rsindex b9d80e7150f..31960fbc1ec 100644--- a/crates/workspace/src/workspace.rs+++ b/crates/workspace/src/workspace.rs@@ -118,7 +118,8 @@ actions!(NewTerminal,NewSearch,Feedback,- Restart+ Restart,+ Welcome]);@@ -198,7 +199,7 @@ pub fn init(app_state: Arc<AppState>, cx: &mut MutableAppContext) {});cx.add_global_action({let app_state = Arc::downgrade(&app_state);- move |_: &NewFile, cx: &mut MutableAppContext| {+ move |_: &Welcome, cx: &mut MutableAppContext| {if let Some(app_state) = app_state.upgrade() {open_new(&app_state, cx).detach();}@@ -2865,7 +2866,7 @@ pub fn open_new(app_state: &Arc<AppState>, cx: &mut MutableAppContext) -> Task<(workspace.update(&mut cx, |_, cx| {if opened_paths.is_empty() {- cx.dispatch_action(NewFile);+ cx.dispatch_action(Welcome);}})})diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rsindex cc930774d58..298e8ef8b9c 100644--- a/crates/zed/src/main.rs+++ b/crates/zed/src/main.rs@@ -43,7 +43,7 @@ use theme::ThemeRegistry;use util::StaffMode;use util::{channel::RELEASE_CHANNEL, paths, ResultExt, TryFutureExt};use workspace::{- self, item::ItemHandle, notifications::NotifyResultExt, AppState, NewFile, OpenPaths, Workspace,+ self, item::ItemHandle, notifications::NotifyResultExt, AppState, OpenPaths, Welcome, Workspace,};use zed::{self, build_window_options, initialize_workspace, languages, menus};@@ -260,7 +260,7 @@ async fn restore_or_create_workspace(mut cx: AsyncAppContext) {});} else {cx.update(|cx| {- cx.dispatch_global_action(NewFile);+ cx.dispatch_global_action(Welcome);});}}