Skip to content

Added drag and drop file support#61

Open
d0rianb wants to merge 4 commits intoQuantumBadger:masterfrom
d0rianb:master
Open

Added drag and drop file support#61
d0rianb wants to merge 4 commits intoQuantumBadger:masterfrom
d0rianb:master

Conversation

@d0rianb
Copy link

@d0rianb d0rianb commented May 6, 2022

I introduce the glutin::event::WindowEvent::{DroppedFile, HoveredFile, HoveredFileCancelled} into speedy2d.
I added a new method: on_file_drag to the WindowHandler trait.

@QuantumBadger
Copy link
Owner

QuantumBadger commented May 15, 2022

Thank you, and sorry for the delay in reviewing this! It looks good to me, but it needs reformatting using cargo +nightly fmt to pass the CI checks.

It also looks like there are some problems building for WebAssembly, which doesn't use Glutin for windowing.

To run the checks locally, see the "precommit" section of the justfile:

https://github.com/QuantumBadger/Speedy2D/blob/master/justfile

@d0rianb
Copy link
Author

d0rianb commented May 16, 2022

I made the changes so the file state is no longer stored in the window helper. This commit pass the CI test except for the build ones (I'm not working on Linux so the automated test aren't working)

@QuantumBadger
Copy link
Owner

Thanks! I've pushed a commit that fixes the build.

Before I merge this in, I'm going to need to think about how this API will work for WebAssembly in future. In that case we won't have a file "path", but I guess some binary data instead. So before I can integrate this I may need to make it more generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants