mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-12 05:27:07 +00:00
Absolutely position channel buttons (#3840)
This PR absolutely positions the channel buttons on top of the channels. This prevents the buttons from getting pushed off the edge of the panel when the channel names are long. Still needs some fine-tuning, but gets us closer to where we want to be. Release Notes: - N/A
This commit is contained in:
parent
cb6652e7bf
commit
9996fbee54
1 changed files with 43 additions and 27 deletions
|
@ -2168,6 +2168,19 @@ impl CollabPanel {
|
|||
)
|
||||
.end_slot(
|
||||
h_stack()
|
||||
.absolute()
|
||||
.right_0()
|
||||
// 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)
|
||||
.child(
|
||||
h_stack()
|
||||
// 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.
|
||||
.group_hover("", |style| {
|
||||
style.bg(cx.theme().colors().ghost_element_hover)
|
||||
})
|
||||
.child(
|
||||
IconButton::new("channel_chat", Icon::MessageBubbles)
|
||||
.icon_size(IconSize::Small)
|
||||
|
@ -2192,13 +2205,16 @@ impl CollabPanel {
|
|||
} else {
|
||||
Color::Muted
|
||||
})
|
||||
.when(!has_notes_notification, |this| this.visible_on_hover(""))
|
||||
.when(!has_notes_notification, |this| {
|
||||
this.visible_on_hover("")
|
||||
})
|
||||
.on_click(cx.listener(move |this, _, cx| {
|
||||
this.open_channel_notes(channel_id, cx)
|
||||
}))
|
||||
.tooltip(|cx| Tooltip::text("Open channel notes", cx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.tooltip(|cx| Tooltip::text("Join channel", cx))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue