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 collab-panel2

Conrad Irwincd60d466b1db
diff --cc crates/collab_ui2/src/collab_panel.rs
index b179003901d,3f99fea3156..8c72491295d
--- a/crates/collab_ui2/src/collab_panel.rs
+++ b/crates/collab_ui2/src/collab_panel.rs
@@@ -2484,26 -2501,18 +2484,26 @@@ impl CollabPanel
| Section::Offline => true,
};
- div()
- let header = ListHeader::new(text)
- .when_some(button, |el, button| el.right_button(button))
- .selected(is_selected)
- .when(can_collapse, |el| {
- el.toggle(is_collapsed).on_toggle(
- cx.listener(move |this, _, cx| this.toggle_section_expanded(section, cx)),
- )
- });
-
+ h_stack()
.w_full()
- .child(header)
+ .map(|el| {
+ if can_collapse {
+ el.child(
+ ListItem::new(text.clone())
+ .child(div().w_full().child(Label::new(text)))
+ .toggle(Some(!is_collapsed))
+ .on_click(cx.listener(move |this, _, cx| {
+ this.toggle_section_expanded(section, cx)
+ })),
+ )
+ } else {
+ el.child(
+ ListHeader::new(text)
+ .when_some(button, |el, button| el.right_button(button))
+ .selected(is_selected),
+ )
+ }
+ })
.when(section == Section::Channels, |el| {
el.drag_over::<DraggedChannelView>(|style| {
style.bg(cx.theme().colors().ghost_element_hover)