DragDrop handles drag drop event
(e events.Event)
| 1520 | |
| 1521 | // DragDrop handles drag drop event |
| 1522 | func (tr *Tree) DragDrop(e events.Event) { |
| 1523 | // todo: some kind of validation for source |
| 1524 | tr.UnselectAll() |
| 1525 | de := e.(*events.DragDrop) |
| 1526 | stv := AsTree(de.Source.(Widget)) |
| 1527 | if stv != nil { |
| 1528 | stv.dragClearStates() |
| 1529 | } |
| 1530 | md := de.Data.(mimedata.Mimes) |
| 1531 | mf := func(m *Scene) { |
| 1532 | tr.Scene.Events.dragMenuAddModText(m, de.DropMod) |
| 1533 | tr.makePasteMenu(m, md, func() { |
| 1534 | tr.DropFinalize(de) |
| 1535 | }) |
| 1536 | } |
| 1537 | pos := tr.ContextMenuPos(nil) |
| 1538 | NewMenu(mf, tr.This.(Widget), pos).Run() |
| 1539 | } |
| 1540 | |
| 1541 | // DropFinalize is called to finalize Drop actions on the Source node. |
| 1542 | // Only relevant for DropMod == DropMove. |
nothing calls this directly
no test coverage detected