Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Merge branch 'main' into channel-guests

Conrad Irwin3c0052850ceb
diff --cc crates/collab_ui/src/collab_panel.rs
index f8dd4bf0b76,f4856b22017..663883f9b4b
--- a/crates/collab_ui/src/collab_panel.rs
+++ b/crates/collab_ui/src/collab_panel.rs
@@@ -1838,6 -1759,39 +1839,39 @@@ impl CollabPanel
)
}
+ fn render_filter_input(
+ &self,
+ editor: &View<Editor>,
+ cx: &mut ViewContext<Self>,
+ ) -> impl IntoElement {
+ let settings = ThemeSettings::get_global(cx);
+ let text_style = TextStyle {
- color: if editor.read(cx).read_only() {
++ color: if editor.read(cx).read_only(cx) {
+ cx.theme().colors().text_disabled
+ } else {
+ cx.theme().colors().text
+ },
+ font_family: settings.ui_font.family.clone(),
+ font_features: settings.ui_font.features,
+ font_size: rems(0.875).into(),
+ font_weight: FontWeight::NORMAL,
+ font_style: FontStyle::Normal,
+ line_height: relative(1.3).into(),
+ background_color: None,
+ underline: None,
+ white_space: WhiteSpace::Normal,
+ };
+
+ EditorElement::new(
+ editor,
+ EditorStyle {
+ local_player: cx.theme().players().local(),
+ text: text_style,
+ ..Default::default()
+ },
+ )
+ }
+
fn render_header(
&self,
section: Section,
diff --cc crates/collab_ui/src/collab_titlebar_item.rs
index 81a71da27ed,c013f8d4322..1fcce1488bb
--- a/crates/collab_ui/src/collab_titlebar_item.rs
+++ b/crates/collab_ui/src/collab_titlebar_item.rs
@@@ -205,22 -207,21 +209,23 @@@ impl Render for CollabTitlebarItem
.detach_and_log_err(cx);
}),
)
- .child(
- IconButton::new(
- "mute-microphone",
- if is_muted {
- ui::Icon::MicMute
- } else {
- ui::Icon::Mic
- },
+ .when(!read_only, |this| {
+ this.child(
+ IconButton::new(
+ "mute-microphone",
+ if is_muted {
+ ui::Icon::MicMute
+ } else {
+ ui::Icon::Mic
+ },
+ )
+ .style(ButtonStyle::Subtle)
+ .icon_size(IconSize::Small)
+ .selected(is_muted)
++ .selected_style(ButtonStyle::Tinted(TintColor::Negative))
+ .on_click(move |_, cx| crate::toggle_mute(&Default::default(), cx)),
)
- .style(ButtonStyle::Subtle)
- .selected_style(ButtonStyle::Tinted(TintColor::Negative))
- .icon_size(IconSize::Small)
- .selected(is_muted)
- .on_click(move |_, cx| crate::toggle_mute(&Default::default(), cx)),
- )
+ })
.child(
IconButton::new(
"mute-sound",
@@@ -234,30 -236,20 +240,31 @@@
.icon_size(IconSize::Small)
.selected(is_deafened)
.tooltip(move |cx| {
- Tooltip::with_meta("Deafen Audio", None, "Mic will be muted", cx)
+ if !read_only {
+ Tooltip::with_meta(
+ "Deafen Audio",
+ None,
+ "Mic will be muted",
+ cx,
+ )
+ } else {
+ Tooltip::text("Deafen Audio", cx)
+ }
})
- .on_click(move |_, cx| crate::toggle_mute(&Default::default(), cx)),
- )
- .child(
- IconButton::new("screen-share", ui::Icon::Screen)
- .style(ButtonStyle::Subtle)
- .selected_style(ButtonStyle::Tinted(TintColor::Accent))
- .icon_size(IconSize::Small)
- .selected(is_screen_sharing)
- .on_click(move |_, cx| {
- crate::toggle_screen_sharing(&Default::default(), cx)
- }),
+ .on_click(move |_, cx| crate::toggle_deafen(&Default::default(), cx)),
)
+ .when(!read_only, |this| {
+ this.child(
+ IconButton::new("screen-share", ui::Icon::Screen)
+ .style(ButtonStyle::Subtle)
+ .icon_size(IconSize::Small)
+ .selected(is_screen_sharing)
++ .selected_style(ButtonStyle::Tinted(TintColor::Accent))
+ .on_click(move |_, cx| {
+ crate::toggle_screen_sharing(&Default::default(), cx)
+ }),
+ )
+ })
})
.map(|el| {
let status = self.client.status();
@@@ -420,11 -412,8 +427,12 @@@ impl CollabTitlebarItem
room: &Room,
project_id: Option<u64>,
current_user: &Arc<User>,
+ cx: &ViewContext<Self>,
) -> Option<FacePile> {
+ if room.role_for_user(user.id) == Some(proto::ChannelRole::Guest) {
+ return None;
+ }
+
let followers = project_id.map_or(&[] as &[_], |id| room.followers_for(peer_id, id));
let pile = FacePile::default()