mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
apps/gophers: simplify type switch
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+8
-10
@@ -198,16 +198,14 @@ func (a *App) run() error {
|
|||||||
a.w.Redraw()
|
a.w.Redraw()
|
||||||
case e := <-a.w.Events():
|
case e := <-a.w.Events():
|
||||||
switch e := e.(type) {
|
switch e := e.(type) {
|
||||||
case input.Event:
|
case key.ChordEvent:
|
||||||
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)
|
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.Redraw()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case app.StageEvent:
|
case app.StageEvent:
|
||||||
|
|||||||
Reference in New Issue
Block a user