Add a drag-and-drop API
zbaylin opened this issue · 1 comments
zbaylin commented
One thing that would be really nice to have in Revery and Onivim2 would be a drag-and-drop API for system as well as internal elements.
The bindings for the system elements (text & files) exist in reason-sdl2 (revery-ui/reason-sdl2#67) as of today, so all that's required there is plumbing that through the Revery event system!
I think this would closely mirror Revery's Mouse events (src/UI/Mouse.re), because after all you have to both drag and drop with your mouse 🐭.
I wanted to make this issue to centralize the progress made on it, because I couldn't find one that existed already.
Some helpful links:
kyldvs commented
FYI: This is how I implemented drag & drop in my Revery app a while ago, not sure if it's helpful:
- The core library: https://github.com/kyldvs/chesster/blob/master/src/drag/Drag.re
- Using it: https://github.com/kyldvs/chesster/blob/master/src/ui/ChessBoard.re#L318-L325
- Dummy element to render the dragged piece over things: https://github.com/kyldvs/chesster/blob/master/src/ui/MainView.re#L37