xA: make the log effectively read-only
Arch Linux AUR Success Details
OpenBSD 7.5 Success Details
Alpine 3.20 Success Details

This commit is contained in:
Přemysl Eric Janouch 2024-11-13 10:28:04 +01:00
parent 086b879ab8
commit 9c9776bacd
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 8 additions and 1 deletions

View File

@ -1322,7 +1322,8 @@ func (e *inputEntry) SetText(text string) {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
type logEntry struct {
// XXX: Sadly, we can't seem to make it read-only in any way.
// XXX: Sadly, we can't seem to make it actually read-only.
// https://github.com/fyne-io/fyne/issues/5263
widget.Entry
}
@ -1334,6 +1335,12 @@ func newLogEntry() *logEntry {
return e
}
func (e *logEntry) SetText(text string) {
e.OnChanged = nil
e.Entry.SetText(text)
e.OnChanged = func(string) { e.Entry.SetText(text) }
}
func (e *logEntry) AcceptsTab() bool {
return false
}