app,io/pointer: [API] remove CursorNameOp and rename CursorName -> Cursor

It's now possible to directly user pointer.Cursor to add to the ops.

   pointer.CursorText.Add(gtx.Ops)

This is an API change. Use pointer.Cursor directly instead of CursorNameOp.

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2022-02-26 12:54:42 +02:00
committed by Elias Naur
parent 4172566aad
commit cdb288d1f9
18 changed files with 57 additions and 68 deletions
+4 -4
View File
@@ -1338,9 +1338,9 @@ func (w *window) Perform(system.Action) {}
func (w *window) Raise() {}
func (w *window) SetCursor(name pointer.CursorName) {
func (w *window) SetCursor(cursor pointer.Cursor) {
runInJVM(javaVM(), func(env *C.JNIEnv) {
setCursor(env, w.view, name)
setCursor(env, w.view, cursor)
})
}
@@ -1379,8 +1379,8 @@ var androidCursor = [...]uint16{
pointer.CursorNorthWestSouthEastResize: 1017, // TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW
}
func setCursor(env *C.JNIEnv, view C.jobject, name pointer.CursorName) {
curID := androidCursor[name]
func setCursor(env *C.JNIEnv, view C.jobject, cursor pointer.Cursor) {
curID := androidCursor[cursor]
callVoidMethod(env, view, gioView.setCursor, jvalue(curID))
}