Add hover behaviour to tabs

Co-Authored-By: Marshall <marshall@zed.dev>
Co-Authored-By: Nathan <nathan@zed.dev>
This commit is contained in:
Conrad Irwin 2023-11-03 10:54:26 -06:00
parent d3b02c4de4
commit c604a2e34e
6 changed files with 71 additions and 5 deletions

View file

@ -1361,9 +1361,16 @@ impl Pane {
let label = item.tab_content(Some(detail), cx);
let close_icon = || {
let id = item.id();
div()
.id(item.id())
.child(IconElement::new(Icon::Close).color(IconColor::Muted))
.invisible()
.group_hover("", |style| style.visible())
.child(
IconElement::new(Icon::Close)
.color(IconColor::Muted)
.hover_color(IconColor::Accent),
)
.on_click(move |pane: &mut Self, _, cx| {
pane.close_item_by_id(id, SaveIntent::Close, cx)
.detach_and_log_err(cx);
@ -1388,6 +1395,7 @@ impl Pane {
let close_right = ItemSettings::get_global(cx).close_position.right();
div()
.group("")
.id(item.id())
// .on_drag(move |pane, cx| pane.render_tab(ix, item.boxed_clone(), detail, cx))
// .drag_over::<DraggedTab>(|d| d.bg(cx.theme().colors().element_drop_target))