Rename collab_titlebar_item crate to collab_ui

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-09-28 19:14:31 +02:00
parent 8ff4f044b7
commit aa3cb8e35e
8 changed files with 20 additions and 17 deletions

4
Cargo.lock generated
View file

@ -1063,7 +1063,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "collab_titlebar_item" name = "collab_ui"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
@ -7159,7 +7159,7 @@ dependencies = [
"cli", "cli",
"client", "client",
"clock", "clock",
"collab_titlebar_item", "collab_ui",
"collections", "collections",
"command_palette", "command_palette",
"contacts_panel", "contacts_panel",

View file

@ -1,10 +1,10 @@
[package] [package]
name = "collab_titlebar_item" name = "collab_ui"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
[lib] [lib]
path = "src/collab_titlebar_item.rs" path = "src/collab_ui.rs"
doctest = false doctest = false
[features] [features]

View file

@ -1,5 +1,4 @@
mod contacts_popover; use crate::contacts_popover;
use client::{Authenticate, PeerId}; use client::{Authenticate, PeerId};
use clock::ReplicaId; use clock::ReplicaId;
use contacts_popover::ContactsPopover; use contacts_popover::ContactsPopover;
@ -20,7 +19,6 @@ use workspace::{FollowNextCollaborator, ToggleFollow, Workspace};
actions!(contacts_titlebar_item, [ToggleContactsPopover]); actions!(contacts_titlebar_item, [ToggleContactsPopover]);
pub fn init(cx: &mut MutableAppContext) { pub fn init(cx: &mut MutableAppContext) {
contacts_popover::init(cx);
cx.add_action(CollabTitlebarItem::toggle_contacts_popover); cx.add_action(CollabTitlebarItem::toggle_contacts_popover);
} }

View 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);
}

View file

@ -189,7 +189,7 @@ impl ContactsPopover {
fn set_room(&mut self, room: Option<ModelHandle<Room>>, cx: &mut ViewContext<Self>) { fn set_room(&mut self, room: Option<ModelHandle<Room>>, cx: &mut ViewContext<Self>) {
if let Some(room) = room { 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)); self.room = Some((room, observation));
} else { } else {
self.room = None; self.room = None;
@ -198,10 +198,6 @@ impl ContactsPopover {
cx.notify(); 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>) { fn clear_filter(&mut self, _: &Cancel, cx: &mut ViewContext<Self>) {
let did_clear = self.filter_editor.update(cx, |editor, cx| { let did_clear = self.filter_editor.update(cx, |editor, cx| {
if editor.buffer().read(cx).len(cx) > 0 { if editor.buffer().read(cx).len(cx) > 0 {

View file

@ -21,7 +21,7 @@ auto_update = { path = "../auto_update" }
breadcrumbs = { path = "../breadcrumbs" } breadcrumbs = { path = "../breadcrumbs" }
chat_panel = { path = "../chat_panel" } chat_panel = { path = "../chat_panel" }
cli = { path = "../cli" } cli = { path = "../cli" }
collab_titlebar_item = { path = "../collab_titlebar_item" } collab_ui = { path = "../collab_ui" }
collections = { path = "../collections" } collections = { path = "../collections" }
command_palette = { path = "../command_palette" } command_palette = { path = "../command_palette" }
context_menu = { path = "../context_menu" } context_menu = { path = "../context_menu" }

View file

@ -107,7 +107,7 @@ fn main() {
project::Project::init(&client); project::Project::init(&client);
client::Channel::init(&client); client::Channel::init(&client);
client::init(client.clone(), cx); client::init(client.clone(), cx);
collab_titlebar_item::init(cx); collab_ui::init(cx);
command_palette::init(cx); command_palette::init(cx);
editor::init(cx); editor::init(cx);
go_to_line::init(cx); go_to_line::init(cx);

View file

@ -10,7 +10,7 @@ use anyhow::{anyhow, Context, Result};
use assets::Assets; use assets::Assets;
use breadcrumbs::Breadcrumbs; use breadcrumbs::Breadcrumbs;
pub use client; pub use client;
use collab_titlebar_item::CollabTitlebarItem; use collab_ui::CollabTitlebarItem;
use collections::VecDeque; use collections::VecDeque;
pub use contacts_panel; pub use contacts_panel;
use contacts_panel::ContactsPanel; use contacts_panel::ContactsPanel;
@ -21,11 +21,10 @@ use gpui::{
geometry::vector::vec2f, geometry::vector::vec2f,
impl_actions, impl_actions,
platform::{WindowBounds, WindowOptions}, platform::{WindowBounds, WindowOptions},
AssetSource, AsyncAppContext, ModelHandle, TitlebarOptions, ViewContext, WindowKind, AssetSource, AsyncAppContext, TitlebarOptions, ViewContext, WindowKind,
}; };
use language::Rope; use language::Rope;
pub use lsp; pub use lsp;
use postage::watch;
pub use project::{self, fs}; pub use project::{self, fs};
use project_panel::ProjectPanel; use project_panel::ProjectPanel;
use search::{BufferSearchBar, ProjectSearchBar}; use search::{BufferSearchBar, ProjectSearchBar};