temporary disable 2.5.0 entry redo/undo

This commit is contained in:
aynakeya
2024-08-07 21:42:31 +08:00
parent 156901f14c
commit 46c2e2710e
13 changed files with 54 additions and 18 deletions

14
gui/xfyne/patch.go Normal file
View File

@@ -0,0 +1,14 @@
package xfyne
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
"reflect"
)
func EntryDisableUndoRedo(entry *widget.Entry) *widget.Entry {
val := reflect.ValueOf(entry).Elem().FieldByName("shortcut").Addr().UnsafePointer()
(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutRedo{})
(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutUndo{})
return entry
}