widget: include the Editor key handler in the editor clip area

A meaningful clip area for a key handler will matter when we start
auto-scrolling to move focused handlers into view.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-03-30 13:18:01 +02:00
parent e72c46f13c
commit b2d10c2f28
+2 -2
View File
@@ -623,14 +623,14 @@ func (e *Editor) layout(gtx layout.Context, content layout.Widget) layout.Dimens
e.scrollToCaret()
}
defer clip.Rect(image.Rectangle{Max: e.viewSize}).Push(gtx.Ops).Pop()
pointer.CursorText.Add(gtx.Ops)
key.InputOp{Tag: &e.eventKey, Hint: e.InputHint}.Add(gtx.Ops)
if e.requestFocus {
key.FocusOp{Tag: &e.eventKey}.Add(gtx.Ops)
key.SoftKeyboardOp{Show: true}.Add(gtx.Ops)
}
e.requestFocus = false
defer clip.Rect(image.Rectangle{Max: e.viewSize}).Push(gtx.Ops).Pop()
pointer.CursorText.Add(gtx.Ops)
var scrollRange image.Rectangle
if e.SingleLine {