mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
apps/gophers: upgrade to changed input api
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user