mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 07:12:03 +03:00
Rename collab_titlebar_item
crate to collab_ui
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
8ff4f044b7
commit
aa3cb8e35e
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -1063,7 +1063,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "collab_titlebar_item"
|
||||
name = "collab_ui"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
@ -7159,7 +7159,7 @@ dependencies = [
|
||||
"cli",
|
||||
"client",
|
||||
"clock",
|
||||
"collab_titlebar_item",
|
||||
"collab_ui",
|
||||
"collections",
|
||||
"command_palette",
|
||||
"contacts_panel",
|
||||
|
@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "collab_titlebar_item"
|
||||
name = "collab_ui"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
path = "src/collab_titlebar_item.rs"
|
||||
path = "src/collab_ui.rs"
|
||||
doctest = false
|
||||
|
||||
[features]
|
@ -1,5 +1,4 @@
|
||||
mod contacts_popover;
|
||||
|
||||
use crate::contacts_popover;
|
||||
use client::{Authenticate, PeerId};
|
||||
use clock::ReplicaId;
|
||||
use contacts_popover::ContactsPopover;
|
||||
@ -20,7 +19,6 @@ use workspace::{FollowNextCollaborator, ToggleFollow, Workspace};
|
||||
actions!(contacts_titlebar_item, [ToggleContactsPopover]);
|
||||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
contacts_popover::init(cx);
|
||||
cx.add_action(CollabTitlebarItem::toggle_contacts_popover);
|
||||
}
|
||||
|
10
crates/collab_ui/src/collab_ui.rs
Normal file
10
crates/collab_ui/src/collab_ui.rs
Normal file
@ -0,0 +1,10 @@
|
||||
mod collab_titlebar_item;
|
||||
mod contacts_popover;
|
||||
|
||||
pub use collab_titlebar_item::CollabTitlebarItem;
|
||||
use gpui::MutableAppContext;
|
||||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
contacts_popover::init(cx);
|
||||
collab_titlebar_item::init(cx);
|
||||
}
|
@ -189,7 +189,7 @@ impl ContactsPopover {
|
||||
|
||||
fn set_room(&mut self, room: Option<ModelHandle<Room>>, cx: &mut ViewContext<Self>) {
|
||||
if let Some(room) = room {
|
||||
let observation = cx.observe(&room, |this, room, cx| this.room_updated(room, cx));
|
||||
let observation = cx.observe(&room, |_, _, cx| cx.notify());
|
||||
self.room = Some((room, observation));
|
||||
} else {
|
||||
self.room = None;
|
||||
@ -198,10 +198,6 @@ impl ContactsPopover {
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn room_updated(&mut self, room: ModelHandle<Room>, cx: &mut ViewContext<Self>) {
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn clear_filter(&mut self, _: &Cancel, cx: &mut ViewContext<Self>) {
|
||||
let did_clear = self.filter_editor.update(cx, |editor, cx| {
|
||||
if editor.buffer().read(cx).len(cx) > 0 {
|
@ -21,7 +21,7 @@ auto_update = { path = "../auto_update" }
|
||||
breadcrumbs = { path = "../breadcrumbs" }
|
||||
chat_panel = { path = "../chat_panel" }
|
||||
cli = { path = "../cli" }
|
||||
collab_titlebar_item = { path = "../collab_titlebar_item" }
|
||||
collab_ui = { path = "../collab_ui" }
|
||||
collections = { path = "../collections" }
|
||||
command_palette = { path = "../command_palette" }
|
||||
context_menu = { path = "../context_menu" }
|
||||
|
@ -107,7 +107,7 @@ fn main() {
|
||||
project::Project::init(&client);
|
||||
client::Channel::init(&client);
|
||||
client::init(client.clone(), cx);
|
||||
collab_titlebar_item::init(cx);
|
||||
collab_ui::init(cx);
|
||||
command_palette::init(cx);
|
||||
editor::init(cx);
|
||||
go_to_line::init(cx);
|
||||
|
@ -10,7 +10,7 @@ use anyhow::{anyhow, Context, Result};
|
||||
use assets::Assets;
|
||||
use breadcrumbs::Breadcrumbs;
|
||||
pub use client;
|
||||
use collab_titlebar_item::CollabTitlebarItem;
|
||||
use collab_ui::CollabTitlebarItem;
|
||||
use collections::VecDeque;
|
||||
pub use contacts_panel;
|
||||
use contacts_panel::ContactsPanel;
|
||||
@ -21,11 +21,10 @@ use gpui::{
|
||||
geometry::vector::vec2f,
|
||||
impl_actions,
|
||||
platform::{WindowBounds, WindowOptions},
|
||||
AssetSource, AsyncAppContext, ModelHandle, TitlebarOptions, ViewContext, WindowKind,
|
||||
AssetSource, AsyncAppContext, TitlebarOptions, ViewContext, WindowKind,
|
||||
};
|
||||
use language::Rope;
|
||||
pub use lsp;
|
||||
use postage::watch;
|
||||
pub use project::{self, fs};
|
||||
use project_panel::ProjectPanel;
|
||||
use search::{BufferSearchBar, ProjectSearchBar};
|
||||
|
Loading…
Reference in New Issue
Block a user