@@ -87,10 +87,10 @@ type Click struct {
8787}
8888
8989// ClickEvent represent a click action, either a
90- // TypePress for the beginning of a click or a
91- // TypeClick for a completed click.
90+ // KindPress for the beginning of a click or a
91+ // KindClick for a completed click.
9292type ClickEvent struct {
93- Type ClickType
93+ Kind ClickKind
9494 Position image.Point
9595 Source pointer.Source
9696 Modifiers key.Modifiers
@@ -99,7 +99,7 @@ type ClickEvent struct {
9999 NumClicks int
100100}
101101
102- type ClickType uint8
102+ type ClickKind uint8
103103
104104// Drag detects drag gestures in the form of pointer.Drag events.
105105type Drag struct {
@@ -136,15 +136,15 @@ const (
136136)
137137
138138const (
139- // TypePress is reported for the first pointer
139+ // KindPress is reported for the first pointer
140140 // press.
141- TypePress ClickType = iota
142- // TypeClick is reported when a click action
141+ KindPress ClickKind = iota
142+ // KindClick is reported when a click action
143143 // is complete.
144- TypeClick
145- // TypeCancel is reported when the gesture is
144+ KindClick
145+ // KindCancel is reported when the gesture is
146146 // cancelled.
147- TypeCancel
147+ KindCancel
148148)
149149
150150const (
@@ -192,17 +192,17 @@ func (c *Click) Events(q event.Queue) []ClickEvent {
192192 }
193193 c .pressed = false
194194 if ! c .entered || c .hovered {
195- events = append (events , ClickEvent {Type : TypeClick , Position : e .Position .Round (), Source : e .Source , Modifiers : e .Modifiers , NumClicks : c .clicks })
195+ events = append (events , ClickEvent {Kind : KindClick , Position : e .Position .Round (), Source : e .Source , Modifiers : e .Modifiers , NumClicks : c .clicks })
196196 } else {
197- events = append (events , ClickEvent {Type : TypeCancel })
197+ events = append (events , ClickEvent {Kind : KindCancel })
198198 }
199199 case pointer .Cancel :
200200 wasPressed := c .pressed
201201 c .pressed = false
202202 c .hovered = false
203203 c .entered = false
204204 if wasPressed {
205- events = append (events , ClickEvent {Type : TypeCancel })
205+ events = append (events , ClickEvent {Kind : KindCancel })
206206 }
207207 case pointer .Press :
208208 if c .pressed {
@@ -224,7 +224,7 @@ func (c *Click) Events(q event.Queue) []ClickEvent {
224224 c .clicks = 1
225225 }
226226 c .clickedAt = e .Time
227- events = append (events , ClickEvent {Type : TypePress , Position : e .Position .Round (), Source : e .Source , Modifiers : e .Modifiers , NumClicks : c .clicks })
227+ events = append (events , ClickEvent {Kind : KindPress , Position : e .Position .Round (), Source : e .Source , Modifiers : e .Modifiers , NumClicks : c .clicks })
228228 case pointer .Leave :
229229 if ! c .pressed {
230230 c .pid = e .PointerID
@@ -444,13 +444,13 @@ func (a Axis) String() string {
444444 }
445445}
446446
447- func (ct ClickType ) String () string {
447+ func (ct ClickKind ) String () string {
448448 switch ct {
449- case TypePress :
449+ case KindPress :
450450 return "TypePress"
451- case TypeClick :
451+ case KindClick :
452452 return "TypeClick"
453- case TypeCancel :
453+ case KindCancel :
454454 return "TypeCancel"
455455 default :
456456 panic ("invalid ClickType" )
0 commit comments