diff --git a/crates/collab_ui2/src/collab_panel.rs b/crates/collab_ui2/src/collab_panel.rs index 6b9f8a841b61becc9eef68a2cc0cac3bc72332bd..6133eb2a33328a36c6f25f7ab11dcf9bf20d5bff 100644 --- a/crates/collab_ui2/src/collab_panel.rs +++ b/crates/collab_ui2/src/collab_panel.rs @@ -2163,18 +2163,33 @@ impl CollabPanel { .child( h_stack() .id(channel_id as usize) + // HACK: This is a dirty hack to help with the positioning of the button container. + // + // We're using a pixel width for the elements but then allowing the contents to + // overflow. This means that the label and facepile will be shown, but will not + // push the button container off the edge of the panel. + .w_px() .child(Label::new(channel.name.clone())) .children(face_pile.map(|face_pile| face_pile.render(cx))), ) .end_slot( h_stack() .absolute() - .right_0() + // We're using a negative coordinate for the right anchor to + // counteract the padding of the `ListItem`. + // + // This prevents a gap from showing up between the background + // of this element and the edge of the collab panel. + .right(rems(-0.5)) // HACK: Without this the channel name clips on top of the icons, but I'm not sure why. .z_index(10) .bg(cx.theme().colors().panel_background) + .when(is_selected || is_active, |this| { + this.bg(cx.theme().colors().ghost_element_selected) + }) .child( h_stack() + .px_1() // The element hover background has a slight transparency to it, so we // need to apply it to the inner element so that it blends with the solid // background color of the absolutely-positioned element.