mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +00:00
io/input,io/clipboard: [API] replace WriteOp with command
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package widget
|
||||
|
||||
import (
|
||||
"image"
|
||||
"io"
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
@@ -332,7 +333,7 @@ func (e *Selectable) command(gtx layout.Context, k key.Event) {
|
||||
case "C", "X":
|
||||
e.scratch = e.text.SelectedText(e.scratch)
|
||||
if text := string(e.scratch); text != "" {
|
||||
clipboard.WriteOp{Text: text}.Add(gtx.Ops)
|
||||
gtx.Queue(clipboard.WriteCmd{Type: "application/text", Data: io.NopCloser(strings.NewReader(text))})
|
||||
}
|
||||
// Select all
|
||||
case "A":
|
||||
|
||||
Reference in New Issue
Block a user