io/input,io/transfer: [API] replace OfferOp with command

Also delete two tests that are no longer relevant.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-09 17:38:53 -05:00
parent eed93aaffe
commit a3c539b3c2
8 changed files with 73 additions and 221 deletions
+2 -6
View File
@@ -77,12 +77,8 @@ func (d *Draggable) Update(gtx layout.Context) (mime string, requested bool) {
// Offer the data ready for a drop. Must be called after being Requested.
// The mime must be one in the requested list.
func (d *Draggable) Offer(ops *op.Ops, mime string, data io.ReadCloser) {
transfer.OfferOp{
Tag: &d.handle,
Type: mime,
Data: data,
}.Add(ops)
func (d *Draggable) Offer(gtx layout.Context, mime string, data io.ReadCloser) {
gtx.Queue(transfer.OfferCmd{Tag: &d.handle, Type: mime, Data: data})
}
// Pos returns the drag position relative to its initial click position.