mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
cmd: update to latest 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
|
go 1.12
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gioui.org/ui v0.0.0-20190621150145-7aa7bb3be408
|
gioui.org/ui v0.0.0-20190621151416-0b6dd4efd95e
|
||||||
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-20190321205749-f0864edee7f3
|
golang.org/x/exp v0.0.0-20190321205749-f0864edee7f3
|
||||||
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f
|
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ func (a *App) run() error {
|
|||||||
switch e := e.(type) {
|
switch e := e.(type) {
|
||||||
case input.Event:
|
case input.Event:
|
||||||
a.inputs.Add(e)
|
a.inputs.Add(e)
|
||||||
if e, ok := e.(key.Chord); ok {
|
if e, ok := e.(key.ChordEvent); ok {
|
||||||
switch e.Name {
|
switch e.Name {
|
||||||
case key.NameEscape:
|
case key.NameEscape:
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
@@ -189,7 +189,7 @@ func (a *App) run() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case app.ChangeStage:
|
case app.StageEvent:
|
||||||
if e.Stage >= app.StageRunning {
|
if e.Stage >= app.StageRunning {
|
||||||
if a.ctxCancel == nil {
|
if a.ctxCancel == nil {
|
||||||
a.ctx, a.ctxCancel = context.WithCancel(context.Background())
|
a.ctx, a.ctxCancel = context.WithCancel(context.Background())
|
||||||
@@ -203,7 +203,7 @@ func (a *App) run() error {
|
|||||||
a.ctxCancel = nil
|
a.ctxCancel = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case *app.Command:
|
case *app.CommandEvent:
|
||||||
switch e.Type {
|
switch e.Type {
|
||||||
case app.CommandBack:
|
case app.CommandBack:
|
||||||
if a.selectedUser != nil {
|
if a.selectedUser != nil {
|
||||||
@@ -211,7 +211,7 @@ func (a *App) run() error {
|
|||||||
e.Cancel = true
|
e.Cancel = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case app.Draw:
|
case app.DrawEvent:
|
||||||
ops.Reset()
|
ops.Reset()
|
||||||
a.cfg = e.Config
|
a.cfg = e.Config
|
||||||
cs := layout.ExactConstraints(a.w.Size())
|
cs := layout.ExactConstraints(a.w.Size())
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ func loop(w *app.Window) {
|
|||||||
for w.IsAlive() {
|
for w.IsAlive() {
|
||||||
e := <-w.Events()
|
e := <-w.Events()
|
||||||
switch e := e.(type) {
|
switch e := e.(type) {
|
||||||
case app.Draw:
|
case app.DrawEvent:
|
||||||
cfg = e.Config
|
cfg = e.Config
|
||||||
cs := layout.ExactConstraints(w.Size())
|
cs := layout.ExactConstraints(w.Size())
|
||||||
ops.Reset()
|
ops.Reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user