From 96b52d3493d3158e24ce0b329925c7fbca8240fa Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 12 Jul 2019 00:07:18 +0200 Subject: [PATCH] apps/gophers: upgrade to changed input api Signed-off-by: Elias Naur --- apps/go.mod | 2 +- apps/gophers/main.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/go.mod b/apps/go.mod index d4aa4afe..f958088e 100644 --- a/apps/go.mod +++ b/apps/go.mod @@ -3,7 +3,7 @@ module gioui.org/apps go 1.12 require ( - gioui.org/ui v0.0.0-20190711181310-0d49eb3f4b31 + gioui.org/ui v0.0.0-20190711220556-a22bcfc88c89 github.com/google/go-github/v24 v24.0.1 golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 diff --git a/apps/gophers/main.go b/apps/gophers/main.go index 1c055c4c..fe79aa47 100644 --- a/apps/gophers/main.go +++ b/apps/gophers/main.go @@ -52,7 +52,7 @@ type App struct { cfg app.Config faces *measure.Faces - inputs *input.Queue + inputs *input.Router fab *ActionButton @@ -99,7 +99,7 @@ type redrawer func() type ActionButton struct { config ui.Config - inputs input.Events + inputs input.Queue face text.Face Open bool icons []*icon @@ -262,7 +262,7 @@ func newApp(w *app.Window) *App { a := &App{ w: w, updateUsers: make(chan []*user), - inputs: new(input.Queue), + inputs: new(input.Router), } a.faces = &measure.Faces{Config: &a.cfg} a.usersList = &layout.List{ @@ -400,7 +400,7 @@ func (a *App) face(f *sfnt.Font, size float32) text.Face { func (a *App) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens { for i := range a.userClicks { click := &a.userClicks[i] - for e, ok := click.Next(a.inputs); ok; e, ok = click.Next(a.inputs) { + for _, e := range click.Events(a.inputs) { if e.Type == gesture.TypeClick { a.selectedUser = a.newUserPage(a.users[i]) }