Fix build by updating droppable drop handling
This commit is contained in:
parent
20e09aaad1
commit
66f046af27
|
|
@ -297,8 +297,19 @@ func (d *Droppable) DraggedOut() {}
|
||||||
|
|
||||||
// Dropped handles drop events
|
// Dropped handles drop events
|
||||||
func (d *Droppable) Dropped(ev *desktop.DragEvent) {
|
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)
|
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