io/pointer: added CursorNameOp

The cursor can now be customized for a given area.

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2020-12-08 18:54:50 +01:00
committed by Elias Naur
parent 675e86b8e8
commit 7c5bcd3db8
6 changed files with 57 additions and 3 deletions
+4 -1
View File
@@ -379,7 +379,10 @@ func (e *Editor) Layout(gtx layout.Context, sh text.Shaper, font text.Font, size
}
e.makeValid()
return e.layout(gtx)
dims := e.layout(gtx)
pointer.Rect(image.Rectangle{Max: dims.Size}).Add(gtx.Ops)
pointer.CursorNameOp{Name: pointer.CursorText}.Add(gtx.Ops)
return dims
}
func (e *Editor) layout(gtx layout.Context) layout.Dimensions {