wip new mouse region events

This commit is contained in:
K Simmons 2022-07-21 22:23:56 -07:00
parent 4b945f5694
commit 53add253b6
2 changed files with 30 additions and 0 deletions

View file

@ -1022,6 +1022,19 @@ impl Pane {
cx.dispatch_action(ActivateItem(ix));
})
.on_click(MouseButton::Middle, close_tab_callback)
.on_drag(MouseButton::Left, |_, cx| {
cx.global::<DragAndDrop>().dragging(some view handle)
})
.on_mouse_up_out(MouseButton::Left, |_, cx| {
cx.global::<DragAndDrop>().stopped_dragging(some view handle)
})
.on_drag_over(MouseButton::Left, |started, _, cx| {
if started {
if let Some(tab) = cx.global::<DragAndDrop>().current_dragged::<Tab>() {
cx.dispatch_action(ReceivingTab)
}
}
})
.boxed()
})
}