Merge pull request #1511 from zed-industries/rename-sidebar-items-toggle

Rename `{project_panel,contacts_panel}::Toggle` to `ToggleFocus`
This commit is contained in:
Antonio Scandurra
2022-08-15 15:02:41 +02:00
committed by GitHub
5 changed files with 12 additions and 8 deletions
+2 -2
View File
@@ -308,7 +308,7 @@
"cmd-p": "file_finder::Toggle",
"cmd-shift-p": "command_palette::Toggle",
"cmd-shift-m": "diagnostics::Deploy",
"cmd-shift-e": "project_panel::Toggle",
"cmd-shift-e": "project_panel::ToggleFocus",
"cmd-alt-s": "workspace::SaveAll"
}
},
@@ -393,7 +393,7 @@
{
"context": "Workspace",
"bindings": {
"cmd-shift-c": "contacts_panel::Toggle",
"cmd-shift-c": "contacts_panel::ToggleFocus",
"cmd-shift-b": "workspace::ToggleRightSidebar"
}
},
+1 -1
View File
@@ -26,7 +26,7 @@ use std::{ops::DerefMut, sync::Arc};
use theme::IconButton;
use workspace::{sidebar::SidebarItem, JoinProject, ToggleProjectOnline, Workspace};
actions!(contacts_panel, [Toggle]);
actions!(contacts_panel, [ToggleFocus]);
impl_actions!(
contacts_panel,
+1 -1
View File
@@ -111,7 +111,7 @@ actions!(
Paste,
Delete,
Rename,
Toggle
ToggleFocus
]
);
impl_internal_actions!(project_panel, [Open, ToggleExpanded, DeployContextMenu]);
+2 -2
View File
@@ -242,11 +242,11 @@ pub fn menus() -> Vec<Menu<'static>> {
MenuItem::Separator,
MenuItem::Action {
name: "Project Panel",
action: Box::new(project_panel::Toggle),
action: Box::new(project_panel::ToggleFocus),
},
MenuItem::Action {
name: "Contacts Panel",
action: Box::new(contacts_panel::Toggle),
action: Box::new(contacts_panel::ToggleFocus),
},
MenuItem::Action {
name: "Command Palette",
+6 -2
View File
@@ -201,12 +201,16 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
},
);
cx.add_action(
|workspace: &mut Workspace, _: &project_panel::Toggle, cx: &mut ViewContext<Workspace>| {
|workspace: &mut Workspace,
_: &project_panel::ToggleFocus,
cx: &mut ViewContext<Workspace>| {
workspace.toggle_sidebar_item_focus(Side::Left, 0, cx);
},
);
cx.add_action(
|workspace: &mut Workspace, _: &contacts_panel::Toggle, cx: &mut ViewContext<Workspace>| {
|workspace: &mut Workspace,
_: &contacts_panel::ToggleFocus,
cx: &mut ViewContext<Workspace>| {
workspace.toggle_sidebar_item_focus(Side::Right, 0, cx);
},
);