Merge pull request #2063 from zed-industries/active-tab-close-icon-pointing-hand

Avoid stomping on tab close icon's cursor style
This commit is contained in:
Julia 2023-01-23 11:48:35 -05:00 committed by GitHub
commit 4678f6e0a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1150,7 +1150,7 @@ impl Pane {
row.add_child({
enum Tab {}
dragged_item_receiver::<Tab, _>(ix, ix, true, None, cx, {
let mut receiver = dragged_item_receiver::<Tab, _>(ix, ix, true, None, cx, {
let item = item.clone();
let pane = pane.clone();
let detail = detail.clone();
@ -1162,12 +1162,13 @@ impl Pane {
let hovered = mouse_state.hovered();
Self::render_tab(&item, pane, ix == 0, detail, hovered, tab_style, cx)
}
})
.with_cursor_style(if pane_active && tab_active {
CursorStyle::Arrow
} else {
CursorStyle::PointingHand
})
});
if !pane_active || !tab_active {
receiver = receiver.with_cursor_style(CursorStyle::PointingHand);
}
receiver
.on_down(MouseButton::Left, move |_, cx| {
cx.dispatch_action(ActivateItem(ix));
cx.propagate_event();