add toggle right and bottom dock actions

This commit is contained in:
Joseph Lyons 2023-05-23 13:53:56 -04:00
parent aac83ceea7
commit 2457c55fe7
2 changed files with 10 additions and 0 deletions

View file

@ -119,6 +119,8 @@ actions!(
ActivateNextPane,
FollowNextCollaborator,
ToggleLeftDock,
ToggleRightDock,
ToggleBottomDock,
NewTerminal,
ToggleTerminalFocus,
NewSearch,
@ -250,6 +252,12 @@ pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
cx.add_action(|workspace: &mut Workspace, _: &ToggleLeftDock, cx| {
workspace.toggle_dock(DockPosition::Left, cx);
});
cx.add_action(|workspace: &mut Workspace, _: &ToggleRightDock, cx| {
workspace.toggle_dock(DockPosition::Right, cx);
});
cx.add_action(|workspace: &mut Workspace, _: &ToggleBottomDock, cx| {
workspace.toggle_dock(DockPosition::Bottom, cx);
});
cx.add_action(Workspace::activate_pane_at_index);
cx.add_action(|_: &mut Workspace, _: &install_cli::Install, cx| {

View file

@ -90,6 +90,8 @@ pub fn menus() -> Vec<Menu<'static>> {
MenuItem::action("Reset Zoom", super::ResetBufferFontSize),
MenuItem::separator(),
MenuItem::action("Toggle Left Dock", workspace::ToggleLeftDock),
MenuItem::action("Toggle Right Dock", workspace::ToggleRightDock),
MenuItem::action("Toggle Bottom Dock", workspace::ToggleBottomDock),
MenuItem::submenu(Menu {
name: "Editor Layout",
items: vec![