mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 21:13:02 +00:00
fix unsaved change
This commit is contained in:
parent
303216291b
commit
3e92e4d110
2 changed files with 4 additions and 21 deletions
|
@ -1,4 +1,4 @@
|
||||||
use crate::{contact_notification::ContactNotification, contacts_popover};
|
use crate::{contact_notification::ContactNotification, contacts_popover, ToggleScreenSharing};
|
||||||
use call::{ActiveCall, ParticipantLocation};
|
use call::{ActiveCall, ParticipantLocation};
|
||||||
use client::{proto::PeerId, Authenticate, ContactEventKind, User, UserStore};
|
use client::{proto::PeerId, Authenticate, ContactEventKind, User, UserStore};
|
||||||
use clock::ReplicaId;
|
use clock::ReplicaId;
|
||||||
|
@ -10,21 +10,17 @@ use gpui::{
|
||||||
geometry::{rect::RectF, vector::vec2f, PathBuilder},
|
geometry::{rect::RectF, vector::vec2f, PathBuilder},
|
||||||
json::{self, ToJson},
|
json::{self, ToJson},
|
||||||
Border, CursorStyle, Entity, ModelHandle, MouseButton, MutableAppContext, RenderContext,
|
Border, CursorStyle, Entity, ModelHandle, MouseButton, MutableAppContext, RenderContext,
|
||||||
Subscription, Task, View, ViewContext, ViewHandle, WeakViewHandle,
|
Subscription, View, ViewContext, ViewHandle, WeakViewHandle,
|
||||||
};
|
};
|
||||||
use settings::Settings;
|
use settings::Settings;
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
use theme::Theme;
|
use theme::Theme;
|
||||||
use workspace::{FollowNextCollaborator, JoinProject, ToggleFollow, Workspace};
|
use workspace::{FollowNextCollaborator, JoinProject, ToggleFollow, Workspace};
|
||||||
|
|
||||||
actions!(
|
actions!(collab, [ToggleCollaborationMenu, ShareProject]);
|
||||||
collab,
|
|
||||||
[ToggleCollaborationMenu, ToggleScreenSharing, ShareProject]
|
|
||||||
);
|
|
||||||
|
|
||||||
pub fn init(cx: &mut MutableAppContext) {
|
pub fn init(cx: &mut MutableAppContext) {
|
||||||
cx.add_action(CollabTitlebarItem::toggle_contacts_popover);
|
cx.add_action(CollabTitlebarItem::toggle_contacts_popover);
|
||||||
cx.add_global_action(CollabTitlebarItem::toggle_screen_sharing);
|
|
||||||
cx.add_action(CollabTitlebarItem::share_project);
|
cx.add_action(CollabTitlebarItem::share_project);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,19 +168,6 @@ impl CollabTitlebarItem {
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut MutableAppContext) {
|
|
||||||
if let Some(room) = ActiveCall::global(cx).read(cx).room().cloned() {
|
|
||||||
let toggle_screen_sharing = room.update(cx, |room, cx| {
|
|
||||||
if room.is_screen_sharing() {
|
|
||||||
Task::ready(room.unshare_screen(cx))
|
|
||||||
} else {
|
|
||||||
room.share_screen(cx)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
toggle_screen_sharing.detach_and_log_err(cx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_toggle_contacts_button(
|
fn render_toggle_contacts_button(
|
||||||
&self,
|
&self,
|
||||||
theme: &Theme,
|
theme: &Theme,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use gpui::{
|
||||||
};
|
};
|
||||||
use settings::Settings;
|
use settings::Settings;
|
||||||
|
|
||||||
use crate::collab_titlebar_item::ToggleScreenSharing;
|
use crate::ToggleScreenSharing;
|
||||||
|
|
||||||
pub fn init(cx: &mut MutableAppContext) {
|
pub fn init(cx: &mut MutableAppContext) {
|
||||||
let active_call = ActiveCall::global(cx);
|
let active_call = ActiveCall::global(cx);
|
||||||
|
|
Loading…
Reference in a new issue