egui icon indicating copy to clipboard operation
egui copied to clipboard

Add a `released` event to widget Responses

Open Detector-I opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

I want to be able to drag and drop files inside a widget (like TextEdit for example) but the thing is currently there is no way to find out if the dragged files released inside a specific widget. I tried to use is_pointer_button_down_on for this job, but this function only return true if button pressed/released when hovering on the widget (in other word if I drag a file at top of a widget then release mouse button to drop it, it dont receive any release event...), so I think a released Response that return true when ever a button released at top of it would be good.

Describe the solution you'd like

Having a new function named released that return true when a button released at top of widget.

Describe alternatives you've considered

change is_pointer_button_down_on functionality in order to return true in case that a button released at top of it (and not just when it first hovered on it) although I don't think its a good Idea... having a specific function would be better.

Additional context

()

Detector-I avatar May 24 '22 10:05 Detector-I

is https://docs.rs/egui/latest/egui/struct.Response.html#method.drag_released what you want?

coderedart avatar May 24 '22 11:05 coderedart

is https://docs.rs/egui/latest/egui/struct.Response.html#method.drag_released what you want?

no I was talking about system drag and drop (drag and drop a file from for example windows explorer to program), not the drag and drop inside program itself Here is the example but the thing is I want to be able to drop files in separate widget, like having multiple input widget that user can drag files into them separately.

Detector-I avatar May 24 '22 11:05 Detector-I