Allow toggling collaboration menu from the keyboard
This commit is contained in:
parent
3bb1f0097f
commit
89f05ada0b
5 changed files with 32 additions and 10 deletions
|
@ -9,7 +9,7 @@ use anyhow::{anyhow, Context, Result};
|
|||
use assets::Assets;
|
||||
use breadcrumbs::Breadcrumbs;
|
||||
pub use client;
|
||||
use collab_ui::CollabTitlebarItem;
|
||||
use collab_ui::{CollabTitlebarItem, ToggleCollaborationMenu};
|
||||
use collections::VecDeque;
|
||||
pub use editor;
|
||||
use editor::{Editor, MultiBuffer};
|
||||
|
@ -94,6 +94,22 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
|
|||
cx.toggle_full_screen();
|
||||
},
|
||||
);
|
||||
cx.add_action(
|
||||
|workspace: &mut Workspace,
|
||||
_: &ToggleCollaborationMenu,
|
||||
cx: &mut ViewContext<Workspace>| {
|
||||
if let Some(item) = workspace
|
||||
.titlebar_item()
|
||||
.and_then(|item| item.downcast::<CollabTitlebarItem>())
|
||||
{
|
||||
cx.as_mut().defer(move |cx| {
|
||||
item.update(cx, |item, cx| {
|
||||
item.toggle_contacts_popover(&Default::default(), cx);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
cx.add_global_action(quit);
|
||||
cx.add_global_action(move |action: &OpenBrowser, cx| cx.platform().open_url(&action.url));
|
||||
cx.add_global_action(move |_: &IncreaseBufferFontSize, cx| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue