mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-14 05:58:17 +08:00
temporary disable 2.5.0 entry redo/undo
This commit is contained in:
14
gui/xfyne/patch.go
Normal file
14
gui/xfyne/patch.go
Normal 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
|
||||
}
|
||||
11
gui/xfyne/patch_test.go
Normal file
11
gui/xfyne/patch_test.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package xfyne
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEntryDisableUndoRedo(t *testing.T) {
|
||||
entry := widget.NewEntry()
|
||||
EntryDisableUndoRedo(entry)
|
||||
}
|
||||
Reference in New Issue
Block a user