From ce74bc0cbaea2539a6c5b558c693958642775fe9 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 26 Sep 2019 19:15:58 +0200 Subject: [PATCH] ui/layout,ui/app: fix tests, go fmt, update comments Signed-off-by: Elias Naur --- ui/app/os_wayland.go | 20 ++++++++++---------- ui/gesture/gesture.go | 2 +- ui/layout/layout_test.go | 4 ++-- ui/layout/list.go | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go index a138d857..b5b9326f 100644 --- a/ui/app/os_wayland.go +++ b/ui/app/os_wayland.go @@ -98,21 +98,21 @@ type window struct { notify struct { read, write int } - ppdp, ppsp float32 - scroll struct { - time time.Duration - steps image.Point - dist f32.Point + ppdp, ppsp float32 + scroll struct { + time time.Duration + steps image.Point + dist f32.Point } - lastPos f32.Point - lastTouch f32.Point + lastPos f32.Point + lastTouch f32.Point fling struct { yExtrapolation fling.Extrapolation xExtrapolation fling.Extrapolation - anim fling.Animation - start bool - dir f32.Point + anim fling.Animation + start bool + dir f32.Point } stage Stage diff --git a/ui/gesture/gesture.go b/ui/gesture/gesture.go index 78064628..164825a9 100644 --- a/ui/gesture/gesture.go +++ b/ui/gesture/gesture.go @@ -104,7 +104,7 @@ func (c *Click) State() ClickState { return c.state } -// Next returns the next click event, if any. +// Events returns the next click event, if any. func (c *Click) Events(q ui.Queue) []ClickEvent { var events []ClickEvent for _, evt := range q.Events(c) { diff --git a/ui/layout/layout_test.go b/ui/layout/layout_test.go index 987d095e..7d581473 100644 --- a/ui/layout/layout_test.go +++ b/ui/layout/layout_test.go @@ -149,6 +149,6 @@ func (config) Px(v ui.Value) int { return int(v.V + .5) } -func (queue) Next(k ui.Key) (ui.Event, bool) { - return nil, false +func (queue) Events(k ui.Key) []ui.Event { + return nil } diff --git a/ui/layout/list.go b/ui/layout/list.go index 934a319e..42a5f6c5 100644 --- a/ui/layout/list.go +++ b/ui/layout/list.go @@ -66,7 +66,7 @@ const ( const inf = 1e6 -// Init prepares the list for iterating through its children with Next. +// init prepares the list for iterating through its children with next. func (l *List) init(gtx *Context, len int) { if l.more() { panic("unfinished child")