gesture: fix typos in comments, remove unused type

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
Pierre Curto
2021-09-19 10:40:18 +02:00
committed by Elias Naur
parent d1b35bf1d7
commit 7463910191
+7 -11
View File
@@ -44,8 +44,6 @@ type Click struct {
pid pointer.ID pid pointer.ID
} }
type ClickState uint8
// ClickEvent represent a click action, either a // ClickEvent represent a click action, either a
// TypePress for the beginning of a click or a // TypePress for the beginning of a click or a
// TypeClick for a completed click. // TypeClick for a completed click.
@@ -109,7 +107,7 @@ const (
const ( const (
// StateIdle is the default scroll state. // StateIdle is the default scroll state.
StateIdle ScrollState = iota StateIdle ScrollState = iota
// StateDrag is reported during drag gestures. // StateDragging is reported during drag gestures.
StateDragging StateDragging
// StateFlinging is reported when a fling is // StateFlinging is reported when a fling is
// in progress. // in progress.
@@ -120,11 +118,10 @@ var touchSlop = unit.Dp(3)
// Add the handler to the operation list to receive click events. // Add the handler to the operation list to receive click events.
func (c *Click) Add(ops *op.Ops) { func (c *Click) Add(ops *op.Ops) {
op := pointer.InputOp{ pointer.InputOp{
Tag: c, Tag: c,
Types: pointer.Press | pointer.Release | pointer.Enter | pointer.Leave, Types: pointer.Press | pointer.Release | pointer.Enter | pointer.Leave,
} }.Add(ops)
op.Add(ops)
} }
// Hovered returns whether a pointer is inside the area. // Hovered returns whether a pointer is inside the area.
@@ -137,7 +134,7 @@ func (c *Click) Pressed() bool {
return c.pressed return c.pressed
} }
// Events returns the next click event, if any. // Events returns the next click events, if any.
func (c *Click) Events(q event.Queue) []ClickEvent { func (c *Click) Events(q event.Queue) []ClickEvent {
var events []ClickEvent var events []ClickEvent
for _, evt := range q.Events(c) { for _, evt := range q.Events(c) {
@@ -321,12 +318,11 @@ func (s *Scroll) State() ScrollState {
// Add the handler to the operation list to receive drag events. // Add the handler to the operation list to receive drag events.
func (d *Drag) Add(ops *op.Ops) { func (d *Drag) Add(ops *op.Ops) {
op := pointer.InputOp{ pointer.InputOp{
Tag: d, Tag: d,
Grab: d.grab, Grab: d.grab,
Types: pointer.Press | pointer.Drag | pointer.Release, Types: pointer.Press | pointer.Drag | pointer.Release,
} }.Add(ops)
op.Add(ops)
} }
// Events returns the next drag events, if any. // Events returns the next drag events, if any.
@@ -382,7 +378,7 @@ func (d *Drag) Events(cfg unit.Metric, q event.Queue, axis Axis) []pointer.Event
return events return events
} }
// Dragging reports whether it's currently in use. // Dragging reports whether it is currently in use.
func (d *Drag) Dragging() bool { return d.dragging } func (d *Drag) Dragging() bool { return d.dragging }
func (a Axis) String() string { func (a Axis) String() string {