Enable dragging from project panel to panes

Rework gpui2 drag API so that receivers need not specify the dragged view type.

co-authored-by: Max <max@zed.dev>
co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Mikayla 2023-12-14 12:03:17 -08:00 committed by Max Brunsfeld
parent c6e44683e6
commit 8791f7cefc
9 changed files with 190 additions and 100 deletions

View file

@ -493,7 +493,9 @@ impl Render for Dock {
let handler = div()
.id("resize-handle")
.bg(cx.theme().colors().border)
.on_drag(move |cx| cx.build_view(|_| DraggedDock(position)))
.on_drag(DraggedDock(position), |dock, cx| {
cx.build_view(|_| dock.clone())
})
.on_click(cx.listener(|v, e: &ClickEvent, cx| {
if e.down.button == MouseButton::Left && e.down.click_count == 2 {
v.resize_active_panel(None, cx)