From bade2778763168193c9b56ea93005d6c0b7a88d2 Mon Sep 17 00:00:00 2001 From: "Pierre.Curto" Date: Tue, 26 May 2020 11:28:16 +0200 Subject: [PATCH] widget: Clickable: added support for NumClicks Clickable.Clicks() now returns the number of clicks. Signed-off-by: Pierre.Curto --- widget/button.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/widget/button.go b/widget/button.go index 8886107f..2b890603 100644 --- a/widget/button.go +++ b/widget/button.go @@ -28,6 +28,7 @@ type Clickable struct { // Click represents a click. type Click struct { Modifiers key.Modifiers + NumClicks int } // Press represents a past pointer press. @@ -94,6 +95,7 @@ func (b *Clickable) update(gtx layout.Context) { case gesture.TypeClick: b.clicks = append(b.clicks, Click{ Modifiers: e.Modifiers, + NumClicks: e.NumClicks, }) case gesture.TypePress: b.history = append(b.history, Press{