Fix build by updating droppable drop handling
This commit is contained in:
parent
fb5c63cd29
commit
b40129c2f9
|
|
@ -297,8 +297,19 @@ func (d *Droppable) DraggedOut() {}
|
|||
|
||||
// Dropped handles drop events
|
||||
func (d *Droppable) Dropped(ev *desktop.DragEvent) {
|
||||
if d.onDropped != nil && ev != nil {
|
||||
if d.onDropped == nil || ev == nil {
|
||||
return
|
||||
}
|
||||
if len(ev.URIs) > 0 {
|
||||
d.onDropped(ev.URIs)
|
||||
return
|
||||
}
|
||||
if ev.DraggedObj != nil {
|
||||
if fileURI, ok := ev.DraggedObj.(*fyne.StaticResource); ok && fileURI != nil {
|
||||
if u, err := fyne.ParseURI(fileURI.Name()); err == nil {
|
||||
d.onDropped([]fyne.URI{u})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user