mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
layout,app: [API] rename FrameEvent.Queue and Context.Queue to Source
We're about to replace the interface Queue with a concrete input.Source. This change renames the field accordingly. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-3
@@ -53,8 +53,8 @@ type FrameEvent struct {
|
||||
// Frame completes the FrameEvent by drawing the graphical operations
|
||||
// from ops into the window.
|
||||
Frame func(frame *op.Ops)
|
||||
// Queue supplies the events for event handlers.
|
||||
Queue event.Queue
|
||||
// Source supplies the events for event handlers.
|
||||
Source event.Queue
|
||||
}
|
||||
|
||||
// Insets is the space taken up by
|
||||
@@ -96,7 +96,7 @@ func NewContext(ops *op.Ops, e FrameEvent) layout.Context {
|
||||
return layout.Context{
|
||||
Ops: ops,
|
||||
Now: e.Now,
|
||||
Queue: e.Queue,
|
||||
Source: e.Source,
|
||||
Metric: e.Metric,
|
||||
Constraints: layout.Exact(size),
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ func FuzzIME(f *testing.F) {
|
||||
e.Focus()
|
||||
|
||||
var r input.Router
|
||||
gtx := layout.Context{Ops: new(op.Ops), Queue: &r}
|
||||
gtx := layout.Context{Ops: new(op.Ops), Source: &r}
|
||||
// Layout once to register focus.
|
||||
e.Layout(gtx, cache, font.Font{}, unit.Sp(10), op.CallOp{}, op.CallOp{})
|
||||
r.Frame(gtx.Ops)
|
||||
|
||||
+2
-2
@@ -832,7 +832,7 @@ func (w *Window) processEvent(d driver, e event.Event) bool {
|
||||
w.metric = e2.Metric
|
||||
w.hasNextFrame = false
|
||||
e2.Frame = w.update
|
||||
e2.Queue = &w.queue
|
||||
e2.Source = &w.queue
|
||||
|
||||
// Prepare the decorations and update the frame insets.
|
||||
wrapper := &w.decorations.Ops
|
||||
@@ -1014,7 +1014,7 @@ func (w *Window) decorate(d driver, e FrameEvent, o *op.Ops) (size, offset image
|
||||
gtx := layout.Context{
|
||||
Ops: o,
|
||||
Now: e.Now,
|
||||
Queue: e.Queue,
|
||||
Source: e.Source,
|
||||
Metric: e.Metric,
|
||||
Constraints: layout.Exact(e.Size),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user