apps/gophers: update to rename Window.Invalidate method

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-18 18:46:34 +02:00
parent d9d8df989d
commit 75891f024c
2 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ module gioui.org/apps
go 1.12 go 1.12
require ( require (
gioui.org/ui v0.0.0-20190718135811-84fb7279eb3b gioui.org/ui v0.0.0-20190718164546-d9d8df989d4c
github.com/google/go-github/v24 v24.0.1 github.com/google/go-github/v24 v24.0.1
golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f
golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9
+6 -8
View File
@@ -78,7 +78,7 @@ type App struct {
type userPage struct { type userPage struct {
config ui.Config config ui.Config
faces *measure.Faces faces *measure.Faces
redraw redrawer invalidate func()
user *user user *user
commitsList *layout.List commitsList *layout.List
commits []*github.Commit commits []*github.Commit
@@ -101,8 +101,6 @@ type icon struct {
imgSize int imgSize int
} }
type redrawer func()
type ActionButton struct { type ActionButton struct {
config ui.Config config ui.Config
inputs input.Queue inputs input.Queue
@@ -189,7 +187,7 @@ func (a *App) run() error {
case users := <-a.updateUsers: case users := <-a.updateUsers:
a.users = users a.users = users
a.userClicks = make([]gesture.Click, len(users)) a.userClicks = make([]gesture.Click, len(users))
a.w.Redraw() a.w.Invalidate()
case e := <-a.w.Events(): case e := <-a.w.Events():
switch e := e.(type) { switch e := e.(type) {
case key.ChordEvent: case key.ChordEvent:
@@ -199,7 +197,7 @@ func (a *App) run() error {
case 'P': case 'P':
if e.Modifiers.Contain(key.ModCommand) { if e.Modifiers.Contain(key.ModCommand) {
a.profiling = !a.profiling a.profiling = !a.profiling
a.w.Redraw() a.w.Invalidate()
} }
} }
case app.DestroyEvent: case app.DestroyEvent:
@@ -224,7 +222,7 @@ func (a *App) run() error {
if a.selectedUser != nil { if a.selectedUser != nil {
a.selectedUser = nil a.selectedUser = nil
e.Cancel = true e.Cancel = true
a.w.Redraw() a.w.Invalidate()
} }
} }
case app.DrawEvent: case app.DrawEvent:
@@ -422,7 +420,7 @@ func (a *App) newUserPage(user *user) *userPage {
up := &userPage{ up := &userPage{
config: &a.cfg, config: &a.cfg,
faces: a.faces, faces: a.faces,
redraw: a.w.Redraw, invalidate: a.w.Invalidate,
user: user, user: user,
commitsList: &layout.List{Config: &a.cfg, Inputs: a.inputs, Axis: layout.Vertical}, commitsList: &layout.List{Config: &a.cfg, Inputs: a.inputs, Axis: layout.Vertical},
commitsResult: make(chan []*github.Commit, 1), commitsResult: make(chan []*github.Commit, 1),
@@ -491,7 +489,7 @@ func (up *userPage) fetchCommits(ctx context.Context) {
} }
} }
up.commitsResult <- commits up.commitsResult <- commits
up.redraw() up.invalidate()
}() }()
} }