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:
+5
-5
@@ -20,9 +20,9 @@ type Context struct {
|
||||
Constraints Constraints
|
||||
|
||||
Metric unit.Metric
|
||||
// By convention, a nil Queue is a signal to widgets to draw themselves
|
||||
// By convention, a nil Source is a signal to widgets to draw themselves
|
||||
// in a disabled state.
|
||||
Queue event.Queue
|
||||
Source event.Queue
|
||||
// Now is the animation time.
|
||||
Now time.Time
|
||||
|
||||
@@ -47,10 +47,10 @@ func (c Context) Sp(v unit.Sp) int {
|
||||
// Events returns the events available for the key. If no
|
||||
// queue is configured, Events returns nil.
|
||||
func (c Context) Events(k event.Tag) []event.Event {
|
||||
if c.Queue == nil {
|
||||
if c.Source == nil {
|
||||
return nil
|
||||
}
|
||||
return c.Queue.Events(k)
|
||||
return c.Source.Events(k)
|
||||
}
|
||||
|
||||
// Disabled returns a copy of this context with a nil Queue,
|
||||
@@ -59,6 +59,6 @@ func (c Context) Events(k event.Tag) []event.Event {
|
||||
// By convention, a nil Queue is a signal to widgets to draw themselves
|
||||
// in a disabled state.
|
||||
func (c Context) Disabled() Context {
|
||||
c.Queue = nil
|
||||
c.Source = nil
|
||||
return c
|
||||
}
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ func TestListPosition(t *testing.T) {
|
||||
Constraints: Constraints{
|
||||
Max: image.Pt(20, 10),
|
||||
},
|
||||
Queue: r,
|
||||
Source: r,
|
||||
}
|
||||
el := func(gtx Context, idx int) Dimensions {
|
||||
return Dimensions{Size: image.Pt(10, 10)}
|
||||
|
||||
Reference in New Issue
Block a user