Remove LeaveCall
internal action
This commit is contained in:
parent
83436213ad
commit
0469e25de6
2 changed files with 5 additions and 15 deletions
|
@ -13,7 +13,6 @@ use gpui::{
|
||||||
color::Color,
|
color::Color,
|
||||||
elements::*,
|
elements::*,
|
||||||
geometry::{rect::RectF, vector::vec2f, PathBuilder},
|
geometry::{rect::RectF, vector::vec2f, PathBuilder},
|
||||||
impl_internal_actions,
|
|
||||||
json::{self, ToJson},
|
json::{self, ToJson},
|
||||||
platform::{CursorStyle, MouseButton},
|
platform::{CursorStyle, MouseButton},
|
||||||
AppContext, Entity, ImageData, ModelHandle, SceneBuilder, Subscription, View, ViewContext,
|
AppContext, Entity, ImageData, ModelHandle, SceneBuilder, Subscription, View, ViewContext,
|
||||||
|
@ -36,17 +35,11 @@ actions!(
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
impl_internal_actions!(collab, [LeaveCall]);
|
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq)]
|
|
||||||
pub(crate) struct LeaveCall;
|
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
cx.add_action(CollabTitlebarItem::toggle_collaborator_list_popover);
|
cx.add_action(CollabTitlebarItem::toggle_collaborator_list_popover);
|
||||||
cx.add_action(CollabTitlebarItem::toggle_contacts_popover);
|
cx.add_action(CollabTitlebarItem::toggle_contacts_popover);
|
||||||
cx.add_action(CollabTitlebarItem::share_project);
|
cx.add_action(CollabTitlebarItem::share_project);
|
||||||
cx.add_action(CollabTitlebarItem::unshare_project);
|
cx.add_action(CollabTitlebarItem::unshare_project);
|
||||||
cx.add_action(CollabTitlebarItem::leave_call);
|
|
||||||
cx.add_action(CollabTitlebarItem::toggle_user_menu);
|
cx.add_action(CollabTitlebarItem::toggle_user_menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,12 +312,6 @@ impl CollabTitlebarItem {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn leave_call(&mut self, _: &LeaveCall, cx: &mut ViewContext<Self>) {
|
|
||||||
ActiveCall::global(cx)
|
|
||||||
.update(cx, |call, cx| call.hang_up(cx))
|
|
||||||
.detach_and_log_err(cx);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_toggle_contacts_button(
|
fn render_toggle_contacts_button(
|
||||||
&self,
|
&self,
|
||||||
theme: &Theme,
|
theme: &Theme,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use super::collab_titlebar_item::LeaveCall;
|
|
||||||
use crate::contacts_popover;
|
use crate::contacts_popover;
|
||||||
use call::ActiveCall;
|
use call::ActiveCall;
|
||||||
use client::{proto::PeerId, Contact, User, UserStore};
|
use client::{proto::PeerId, Contact, User, UserStore};
|
||||||
|
@ -1002,7 +1001,11 @@ impl ContactList {
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(style.container)
|
.with_style(style.container)
|
||||||
})
|
})
|
||||||
.on_click(MouseButton::Left, |_, _, cx| cx.dispatch_action(LeaveCall))
|
.on_click(MouseButton::Left, |_, _, cx| {
|
||||||
|
ActiveCall::global(cx)
|
||||||
|
.update(cx, |call, cx| call.hang_up(cx))
|
||||||
|
.detach_and_log_err(cx);
|
||||||
|
})
|
||||||
.aligned(),
|
.aligned(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue