mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 20:01:33 +00:00
Fix mouse interaction on contact subsections
This commit is contained in:
parent
3bdd51cb2a
commit
4f040208c6
1 changed files with 19 additions and 11 deletions
|
@ -2484,18 +2484,26 @@ impl CollabPanel {
|
|||
| Section::Offline => true,
|
||||
};
|
||||
|
||||
let header = ListHeader::new(text)
|
||||
.when_some(button, |el, button| el.right_button(button))
|
||||
.selected(is_selected)
|
||||
.when(can_collapse, |el| {
|
||||
el.toggle(Some(is_collapsed)).on_toggle(
|
||||
cx.listener(move |this, _, cx| this.toggle_section_expanded(section, cx)),
|
||||
)
|
||||
});
|
||||
|
||||
h_stack()
|
||||
div()
|
||||
.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)
|
||||
|
|
Loading…
Reference in a new issue