Simplify droppable to match fyne drop signature
This commit is contained in:
parent
73a283e8ef
commit
ce72a280c9
|
|
@ -268,7 +268,6 @@ type Droppable struct {
|
||||||
widget.BaseWidget
|
widget.BaseWidget
|
||||||
content fyne.CanvasObject
|
content fyne.CanvasObject
|
||||||
onDropped func([]fyne.URI)
|
onDropped func([]fyne.URI)
|
||||||
dragged bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDroppable creates a new droppable wrapper
|
// NewDroppable creates a new droppable wrapper
|
||||||
|
|
@ -292,19 +291,14 @@ func (d *Droppable) CreateRenderer() fyne.WidgetRenderer {
|
||||||
// DraggedOver highlights when drag is over (optional)
|
// DraggedOver highlights when drag is over (optional)
|
||||||
func (d *Droppable) DraggedOver(pos fyne.Position) {
|
func (d *Droppable) DraggedOver(pos fyne.Position) {
|
||||||
_ = pos
|
_ = pos
|
||||||
d.dragged = true
|
|
||||||
d.Refresh()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DraggedOut clears highlight (optional)
|
// DraggedOut clears highlight (optional)
|
||||||
func (d *Droppable) DraggedOut() {
|
func (d *Droppable) DraggedOut() {
|
||||||
d.dragged = false
|
|
||||||
d.Refresh()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dropped handles drop events
|
// Dropped handles drop events
|
||||||
func (d *Droppable) Dropped(_ fyne.Position, items []fyne.URI) {
|
func (d *Droppable) Dropped(_ fyne.Position, items []fyne.URI) {
|
||||||
d.dragged = false
|
|
||||||
if d.onDropped != nil && len(items) > 0 {
|
if d.onDropped != nil && len(items) > 0 {
|
||||||
d.onDropped(items)
|
d.onDropped(items)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user