mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-16 15:11:25 +00:00
Wire up the middle mouse button to close tabs (#3714)
This PR wires up the middle mouse button to close tabs. Right now we're doing this using `on_mouse_down`, but we need a way in GPUI2 to have an `on_click` for a mouse button other than the left one. Release Notes: - N/A
This commit is contained in:
parent
cc107f72f8
commit
3e6b84a726
1 changed files with 8 additions and 0 deletions
|
@ -1493,6 +1493,14 @@ impl Pane {
|
|||
.on_click(
|
||||
cx.listener(move |pane: &mut Self, _, cx| pane.activate_item(ix, true, true, cx)),
|
||||
)
|
||||
// TODO: This should be a click listener with the middle mouse button instead of a mouse down listener.
|
||||
.on_mouse_down(
|
||||
MouseButton::Middle,
|
||||
cx.listener(move |pane, _event, cx| {
|
||||
pane.close_item_by_id(item_id, SaveIntent::Close, cx)
|
||||
.detach_and_log_err(cx);
|
||||
}),
|
||||
)
|
||||
.on_drag(
|
||||
DraggedTab {
|
||||
pane: cx.view().clone(),
|
||||
|
|
Loading…
Reference in a new issue