gesture: [API] rename ClickType to ClickKind

"Kind" is the Go idiomatic name for distinguishing structs outside of
the type system.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-06 18:33:56 -05:00
parent 650ccea28d
commit 1686874d07
7 changed files with 31 additions and 31 deletions
+4 -4
View File
@@ -149,8 +149,8 @@ func (b *Clickable) update(gtx layout.Context) {
b.prevClicks = n
for _, e := range b.click.Events(gtx) {
switch e.Type {
case gesture.TypeClick:
switch e.Kind {
case gesture.KindClick:
b.clicks = append(b.clicks, Click{
Modifiers: e.Modifiers,
NumClicks: e.NumClicks,
@@ -158,14 +158,14 @@ func (b *Clickable) update(gtx layout.Context) {
if l := len(b.history); l > 0 {
b.history[l-1].End = gtx.Now
}
case gesture.TypeCancel:
case gesture.KindCancel:
for i := range b.history {
b.history[i].Cancelled = true
if b.history[i].End.IsZero() {
b.history[i].End = gtx.Now
}
}
case gesture.TypePress:
case gesture.KindPress:
if e.Source == pointer.Mouse {
key.FocusOp{Tag: &b.keyTag}.Add(gtx.Ops)
}