emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.61k stars 1.49k forks source link

Register file hover and drop events for areas #4655

Open s-nie opened 2 weeks ago

s-nie commented 2 weeks ago

A convenient feature would be to only allow dropping files in a specific region in the window. As I understand it, this is currently not possible as the pointer position is None while hovering and right after dropping a file. Maybe this is a winit limitation though.

Describe the solution you'd like

Having access to the pointer position while hovering would be enough. Even nicer would be to store the hovered and dropped files in an area's response.

Describe alternatives you've considered

Keeping track of which files have been hovered right before releasing, but this involves keeping track of the information over multiple frames and quickly becomes messy.