io/pointer: CursorNameOp no longer needs an InputOp with Leave and Enter events

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2020-12-15 12:45:16 +01:00
committed by Elias Naur
parent 36b9019649
commit 578c226278
3 changed files with 60 additions and 13 deletions
+2 -4
View File
@@ -379,10 +379,7 @@ func (e *Editor) Layout(gtx layout.Context, sh text.Shaper, font text.Font, size
}
e.makeValid()
dims := e.layout(gtx)
pointer.Rect(image.Rectangle{Max: dims.Size}).Add(gtx.Ops)
pointer.CursorNameOp{Name: pointer.CursorText}.Add(gtx.Ops)
return dims
return e.layout(gtx)
}
func (e *Editor) layout(gtx layout.Context) layout.Dimensions {
@@ -430,6 +427,7 @@ func (e *Editor) layout(gtx layout.Context) layout.Dimensions {
r.Max.X += pointerPadding
r.Max.X += pointerPadding
pointer.Rect(r).Add(gtx.Ops)
pointer.CursorNameOp{Name: pointer.CursorText}.Add(gtx.Ops)
e.scroller.Add(gtx.Ops)
e.clicker.Add(gtx.Ops)
e.caret.on = false