diff --git a/assets/keymaps/default.json b/assets/keymaps/default.json index 1d95c33cbf..8995654523 100644 --- a/assets/keymaps/default.json +++ b/assets/keymaps/default.json @@ -310,7 +310,7 @@ "cmd-shift-m": "diagnostics::Deploy", "cmd-shift-e": "project_panel::ToggleFocus", "cmd-alt-s": "workspace::SaveAll", - "shift-escape": "terminal::DeployModal" + "shift-escape": "workspace::ActivateOrHideDock" } }, // Bindings from Sublime Text @@ -426,12 +426,5 @@ "cmd-v": "terminal::Paste", "cmd-k": "terminal::Clear" } - }, - { - "context": "ModalTerminal", - "bindings": { - "ctrl-cmd-space": "terminal::ShowCharacterPalette", - "shift-escape": "terminal::DeployModal" - } } ] \ No newline at end of file diff --git a/assets/settings/default.json b/assets/settings/default.json index 61af2bcaf9..d8efdc41ff 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -32,6 +32,16 @@ // 4. Save when idle for a certain amount of time: // "autosave": { "after_delay": {"milliseconds": 500} }, "autosave": "off", + // Where to place the dock by default. This setting can take three + // values: + // + // 1. Position the dock attached to the bottom of the workspace + // "default_dock_anchor": "bottom" + // 2. Position the dock to the right of the workspace like a side panel + // "default_dock_anchor": "right" + // 3. Position the dock full screen over the entire workspace" + // "default_dock_anchor": "expanded" + "default_dock_anchor": "right", // How to auto-format modified buffers when saving them. This // setting can take three values: // diff --git a/crates/activity_indicator/src/activity_indicator.rs b/crates/activity_indicator/src/activity_indicator.rs index 7d4d01e8a1..8f6f4bf627 100644 --- a/crates/activity_indicator/src/activity_indicator.rs +++ b/crates/activity_indicator/src/activity_indicator.rs @@ -278,7 +278,7 @@ impl View for ActivityIndicator { fn render(&mut self, cx: &mut RenderContext) -> ElementBox { let (icon, message, action) = self.content_to_render(cx); - let mut element = MouseEventHandler::new::(0, cx, |state, cx| { + let mut element = MouseEventHandler::::new(0, cx, |state, cx| { let theme = &cx .global::() .theme diff --git a/crates/auto_update/src/update_notification.rs b/crates/auto_update/src/update_notification.rs index b0dff3e40c..bbc9b0ea7f 100644 --- a/crates/auto_update/src/update_notification.rs +++ b/crates/auto_update/src/update_notification.rs @@ -29,7 +29,7 @@ impl View for UpdateNotification { let theme = cx.global::().theme.clone(); let theme = &theme.update_notification; - MouseEventHandler::new::(0, cx, |state, cx| { + MouseEventHandler::::new(0, cx, |state, cx| { Flex::column() .with_child( Flex::row() @@ -47,7 +47,7 @@ impl View for UpdateNotification { .boxed(), ) .with_child( - MouseEventHandler::new::(0, cx, |state, _| { + MouseEventHandler::::new(0, cx, |state, _| { let style = theme.dismiss_button.style_for(state, false); Svg::new("icons/x_mark_thin_8.svg") .with_color(style.color) diff --git a/crates/chat_panel/src/chat_panel.rs b/crates/chat_panel/src/chat_panel.rs index 3ff7062f40..6744ae9339 100644 --- a/crates/chat_panel/src/chat_panel.rs +++ b/crates/chat_panel/src/chat_panel.rs @@ -308,7 +308,7 @@ impl ChatPanel { enum SignInPromptLabel {} Align::new( - MouseEventHandler::new::(0, cx, |mouse_state, _| { + MouseEventHandler::::new(0, cx, |mouse_state, _| { Label::new( "Sign in to use chat".to_string(), if mouse_state.hovered { diff --git a/crates/collab/src/integration_tests.rs b/crates/collab/src/integration_tests.rs index 905aa328f2..6b512d950f 100644 --- a/crates/collab/src/integration_tests.rs +++ b/crates/collab/src/integration_tests.rs @@ -298,7 +298,8 @@ async fn test_host_disconnect( let project_b = client_b.build_remote_project(&project_a, cx_a, cx_b).await; assert!(worktree_a.read_with(cx_a, |tree, _| tree.as_local().unwrap().is_shared())); - let (_, workspace_b) = cx_b.add_window(|cx| Workspace::new(project_b.clone(), cx)); + let (_, workspace_b) = + cx_b.add_window(|cx| Workspace::new(project_b.clone(), |_, _| unimplemented!(), cx)); let editor_b = workspace_b .update(cx_b, |workspace, cx| { workspace.open_path((worktree_id, "b.txt"), true, cx) @@ -2786,7 +2787,8 @@ async fn test_collaborating_with_code_actions( // Join the project as client B. let project_b = client_b.build_remote_project(&project_a, cx_a, cx_b).await; - let (_window_b, workspace_b) = cx_b.add_window(|cx| Workspace::new(project_b.clone(), cx)); + let (_window_b, workspace_b) = + cx_b.add_window(|cx| Workspace::new(project_b.clone(), |_, _| unimplemented!(), cx)); let editor_b = workspace_b .update(cx_b, |workspace, cx| { workspace.open_path((worktree_id, "main.rs"), true, cx) @@ -3001,7 +3003,8 @@ async fn test_collaborating_with_renames(cx_a: &mut TestAppContext, cx_b: &mut T let (project_a, worktree_id) = client_a.build_local_project("/dir", cx_a).await; let project_b = client_b.build_remote_project(&project_a, cx_a, cx_b).await; - let (_window_b, workspace_b) = cx_b.add_window(|cx| Workspace::new(project_b.clone(), cx)); + let (_window_b, workspace_b) = + cx_b.add_window(|cx| Workspace::new(project_b.clone(), |_, _| unimplemented!(), cx)); let editor_b = workspace_b .update(cx_b, |workspace, cx| { workspace.open_path((worktree_id, "one.rs"), true, cx) @@ -5224,6 +5227,7 @@ impl TestServer { fs: fs.clone(), build_window_options: Default::default, initialize_workspace: |_, _, _| unimplemented!(), + default_item_factory: |_, _| unimplemented!(), }); Channel::init(&client); @@ -5459,7 +5463,9 @@ impl TestClient { cx: &mut TestAppContext, ) -> ViewHandle { let (_, root_view) = cx.add_window(|_| EmptyView); - cx.add_view(&root_view, |cx| Workspace::new(project.clone(), cx)) + cx.add_view(&root_view, |cx| { + Workspace::new(project.clone(), |_, _| unimplemented!(), cx) + }) } async fn simulate_host( diff --git a/crates/command_palette/src/command_palette.rs b/crates/command_palette/src/command_palette.rs index 9b51415069..c12e68a854 100644 --- a/crates/command_palette/src/command_palette.rs +++ b/crates/command_palette/src/command_palette.rs @@ -350,7 +350,8 @@ mod tests { }); let project = Project::test(app_state.fs.clone(), [], cx).await; - let (_, workspace) = cx.add_window(|cx| Workspace::new(project, cx)); + let (_, workspace) = + cx.add_window(|cx| Workspace::new(project, |_, _| unimplemented!(), cx)); let editor = cx.add_view(&workspace, |cx| { let mut editor = Editor::single_line(None, cx); editor.set_text("abc", cx); diff --git a/crates/contacts_panel/src/contacts_panel.rs b/crates/contacts_panel/src/contacts_panel.rs index fde304cd35..b5460f4d06 100644 --- a/crates/contacts_panel/src/contacts_panel.rs +++ b/crates/contacts_panel/src/contacts_panel.rs @@ -276,7 +276,7 @@ impl ContactsPanel { Section::Offline => "Offline", }; let icon_size = theme.section_icon_size; - MouseEventHandler::new::(section as usize, cx, |_, _| { + MouseEventHandler::
::new(section as usize, cx, |_, _| { Flex::row() .with_child( Svg::new(if is_collapsed { @@ -375,7 +375,7 @@ impl ContactsPanel { let baseline_offset = row.name.text.baseline_offset(font_cache) + (theme.row_height - line_height) / 2.; - MouseEventHandler::new::(project_id as usize, cx, |mouse_state, cx| { + MouseEventHandler::::new(project_id as usize, cx, |mouse_state, cx| { let tree_branch = *tree_branch.style_for(mouse_state, is_selected); let row = theme.project_row.style_for(mouse_state, is_selected); @@ -424,7 +424,7 @@ impl ContactsPanel { return None; } - let button = MouseEventHandler::new::( + let button = MouseEventHandler::::new( project_id as usize, cx, |state, _| { @@ -529,7 +529,7 @@ impl ContactsPanel { enum ToggleOnline {} let project_id = project_handle.id(); - MouseEventHandler::new::(project_id, cx, |state, cx| { + MouseEventHandler::::new(project_id, cx, |state, cx| { let row = theme.project_row.style_for(state, is_selected); let mut worktree_root_names = String::new(); let project = if let Some(project) = project_handle.upgrade(cx.deref_mut()) { @@ -548,7 +548,7 @@ impl ContactsPanel { Flex::row() .with_child({ let button = - MouseEventHandler::new::(project_id, cx, |state, _| { + MouseEventHandler::::new(project_id, cx, |state, _| { let mut style = *theme.private_button.style_for(state, false); if is_going_online { style.color = theme.disabled_button.color; @@ -636,7 +636,7 @@ impl ContactsPanel { if is_incoming { row.add_children([ - MouseEventHandler::new::(user.id as usize, cx, |mouse_state, _| { + MouseEventHandler::::new(user.id as usize, cx, |mouse_state, _| { let button_style = if is_contact_request_pending { &theme.disabled_button } else { @@ -658,7 +658,7 @@ impl ContactsPanel { .contained() .with_margin_right(button_spacing) .boxed(), - MouseEventHandler::new::(user.id as usize, cx, |mouse_state, _| { + MouseEventHandler::::new(user.id as usize, cx, |mouse_state, _| { let button_style = if is_contact_request_pending { &theme.disabled_button } else { @@ -680,7 +680,7 @@ impl ContactsPanel { ]); } else { row.add_child( - MouseEventHandler::new::(user.id as usize, cx, |mouse_state, _| { + MouseEventHandler::::new(user.id as usize, cx, |mouse_state, _| { let button_style = if is_contact_request_pending { &theme.disabled_button } else { @@ -1071,7 +1071,7 @@ impl View for ContactsPanel { .boxed(), ) .with_child( - MouseEventHandler::new::(0, cx, |_, _| { + MouseEventHandler::::new(0, cx, |_, _| { Svg::new("icons/user_plus_16.svg") .with_color(theme.add_contact_button.color) .constrained() @@ -1102,35 +1102,31 @@ impl View for ContactsPanel { if info.count > 0 { Some( - MouseEventHandler::new::( - 0, - cx, - |state, cx| { - let style = - theme.invite_row.style_for(state, false).clone(); + MouseEventHandler::::new(0, cx, |state, cx| { + let style = + theme.invite_row.style_for(state, false).clone(); - let copied = - cx.read_from_clipboard().map_or(false, |item| { - item.text().as_str() == info.url.as_ref() - }); + let copied = + cx.read_from_clipboard().map_or(false, |item| { + item.text().as_str() == info.url.as_ref() + }); - Label::new( - format!( - "{} invite link ({} left)", - if copied { "Copied" } else { "Copy" }, - info.count - ), - style.label.clone(), - ) - .aligned() - .left() - .constrained() - .with_height(theme.row_height) - .contained() - .with_style(style.container) - .boxed() - }, - ) + Label::new( + format!( + "{} invite link ({} left)", + if copied { "Copied" } else { "Copy" }, + info.count + ), + style.label.clone(), + ) + .aligned() + .left() + .constrained() + .with_height(theme.row_height) + .contained() + .with_style(style.container) + .boxed() + }) .with_cursor_style(CursorStyle::PointingHand) .on_click(MouseButton::Left, move |_, cx| { cx.write_to_clipboard(ClipboardItem::new( @@ -1247,7 +1243,8 @@ mod tests { .0 .read_with(cx, |worktree, _| worktree.id().to_proto()); - let (_, workspace) = cx.add_window(|cx| Workspace::new(project.clone(), cx)); + let (_, workspace) = + cx.add_window(|cx| Workspace::new(project.clone(), |_, _| unimplemented!(), cx)); let panel = cx.add_view(&workspace, |cx| { ContactsPanel::new( user_store.clone(), diff --git a/crates/contacts_panel/src/notifications.rs b/crates/contacts_panel/src/notifications.rs index 4cc30560d2..b9a6dba545 100644 --- a/crates/contacts_panel/src/notifications.rs +++ b/crates/contacts_panel/src/notifications.rs @@ -52,7 +52,7 @@ pub fn render_user_notification( .boxed(), ) .with_child( - MouseEventHandler::new::(user.id as usize, cx, |state, _| { + MouseEventHandler::::new(user.id as usize, cx, |state, _| { render_icon_button( theme.dismiss_button.style_for(state, false), "icons/x_mark_thin_8.svg", @@ -90,7 +90,7 @@ pub fn render_user_notification( Flex::row() .with_children(buttons.into_iter().enumerate().map( |(ix, (message, action))| { - MouseEventHandler::new::(ix, cx, |state, _| { + MouseEventHandler::