ui: change events to have "Event" suffixed, not prefixed

Match the Go error naming convention (FooError).

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-06-21 17:08:34 +02:00
parent de5d5e19f5
commit 0b6dd4efd9
12 changed files with 64 additions and 64 deletions
+3 -3
View File
@@ -54,11 +54,11 @@ func (q *keyQueue) Frame(root *ui.Ops, events handlerEvents) {
changed := focus != nil && focus != q.focus
if focus != q.focus {
if q.focus != nil {
events[q.focus] = append(events[q.focus], key.Focus{Focus: false})
events[q.focus] = append(events[q.focus], key.FocusEvent{Focus: false})
}
q.focus = focus
if q.focus != nil {
events[q.focus] = append(events[q.focus], key.Focus{Focus: true})
events[q.focus] = append(events[q.focus], key.FocusEvent{Focus: true})
}
}
switch {
@@ -111,7 +111,7 @@ loop:
h = new(keyHandler)
q.handlers[op.Key] = h
// Reset the handler on (each) first appearance.
events[op.Key] = []Event{key.Focus{Focus: false}}
events[op.Key] = []Event{key.FocusEvent{Focus: false}}
}
h.active = true
case ops.TypeHideInput:
+1 -1
View File
@@ -43,7 +43,7 @@ func (q *Queue) Add(e Event) {
switch e := e.(type) {
case pointer.Event:
q.pqueue.Push(e, q.handlers)
case key.Edit, key.Chord, key.Focus:
case key.EditEvent, key.ChordEvent, key.FocusEvent:
q.kqueue.Push(e, q.handlers)
}
}