io/key: [API] add InputHintOp for specifying the input hint for a tag

We're about to replace key.InputOp with a filter; this change separates
the input hint into its own operation.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-19 18:10:49 -05:00
parent ef8171b971
commit 12a0ad7038
5 changed files with 43 additions and 14 deletions
+2 -1
View File
@@ -651,7 +651,8 @@ func (e *Editor) layout(gtx layout.Context, textMaterial, selectMaterial op.Call
keys = keyFilterAllArrows
}
}
key.InputOp{Tag: &e.eventKey, Hint: e.InputHint, Keys: keys}.Add(gtx.Ops)
key.InputOp{Tag: &e.eventKey, Keys: keys}.Add(gtx.Ops)
key.InputHintOp{Tag: &e.eventKey, Hint: e.InputHint}.Add(gtx.Ops)
e.scroller.Add(gtx.Ops)