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 13:20:48 -08:00
committed by Max Brunsfeld
co-authored by Max Conrad
parent c6e44683e6
commit 8791f7cefc
9 changed files with 190 additions and 100 deletions
+2 -2
View File
@@ -3580,7 +3580,7 @@ impl FocusableView for Workspace {
struct WorkspaceBounds(Bounds<Pixels>);
#[derive(Render)]
#[derive(Clone, Render)]
struct DraggedDock(DockPosition);
impl Render for Workspace {
@@ -3636,7 +3636,7 @@ impl Render for Workspace {
)
.on_drag_move(
cx.listener(|workspace, e: &DragMoveEvent<DraggedDock>, cx| {
match e.drag.read(cx).0 {
match e.drag(cx).0 {
DockPosition::Left => {
let size = workspace.bounds.left() + e.event.position.x;
workspace.left_dock.update(cx, |left_dock, cx| {