Use cmd-b/cmd-r/cmd-j to toggle left/right/bottom dock and focus when opening

Also, bind the same keys with shift to toggle the dock without focusing.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-05-24 15:57:26 +02:00
parent 7534c4e670
commit 50cfe5eec3
6 changed files with 89 additions and 22 deletions

View file

@ -32,7 +32,7 @@ pub fn init(cx: &mut AppContext) {
pub fn show_welcome_experience(app_state: &Arc<AppState>, cx: &mut AppContext) {
open_new(&app_state, cx, |workspace, cx| {
workspace.toggle_dock(DockPosition::Left, cx);
workspace.toggle_dock(DockPosition::Left, false, cx);
let welcome_page = cx.add_view(|cx| WelcomePage::new(workspace, cx));
workspace.add_item_to_center(Box::new(welcome_page.clone()), cx);
cx.focus(&welcome_page);