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

@ -2552,12 +2552,11 @@ impl CollabPanel {
.group("")
.flex()
.w_full()
.on_drag({
let channel = channel.clone();
move |cx| {
let channel = channel.clone();
cx.build_view(|cx| DraggedChannelView { channel, width })
}
.on_drag(channel.clone(), move |channel, cx| {
cx.build_view(|cx| DraggedChannelView {
channel: channel.clone(),
width,
})
})
.drag_over::<DraggedChannelView>(|style| {
style.bg(cx.theme().colors().ghost_element_hover)