forked from joejulian/gio
widget,widget/material: rename widget.Click to widget.Press
Press tracks pointer presses, not clicks, and we're about to add a Click type that does. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -8,7 +8,7 @@ import (
|
||||
type Bool struct {
|
||||
Value bool
|
||||
// Last is the last registered click.
|
||||
Last Click
|
||||
Last Press
|
||||
|
||||
// changeVal tracks Value from the most recent call to Changed.
|
||||
changeVal bool
|
||||
@@ -28,7 +28,7 @@ func (b *Bool) Layout(gtx layout.Context) {
|
||||
for _, e := range b.gesture.Events(gtx) {
|
||||
switch e.Type {
|
||||
case gesture.TypeClick:
|
||||
b.Last = Click{
|
||||
b.Last = Press{
|
||||
Time: gtx.Now(),
|
||||
Position: e.Position,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user