~eliasnaur/gio-patches

gio: Programmatic Click function v1 PROPOSED

Paulo Melo
Paulo Melo: 1
 Programmatic Click function

 1 files changed, 9 insertions(+), 0 deletions(-)
#416048 apple.yml success
#416049 freebsd.yml success
#416050 linux.yml failed
#416051 openbsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/20011/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gio] Programmatic Click function Export this patch

Paulo Melo
---
 widget/button.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/widget/button.go b/widget/button.go
index 9e081d3..53ade08 100644
--- a/widget/button.go
+++ b/widget/button.go
@@ -44,6 +44,14 @@ type Press struct {
	Cancelled bool
}

// Click executes a simple programmatic click
func (b *Clickable) Click() {
	b.clicks = append(b.clicks, Click{
		Modifiers: 0,
		NumClicks: 1,
	})
}

// Clicked reports whether there are pending clicks as would be
// reported by Clicks. If so, Clicked removes the earliest click.
func (b *Clickable) Clicked() bool {
@@ -82,6 +90,7 @@ func (b *Clickable) History() []Press {
	return b.history
}

// Layout and update the button state
func (b *Clickable) Layout(gtx layout.Context) layout.Dimensions {
	b.update(gtx)
	stack := op.Save(gtx.Ops)
-- 
2.26.2
builds.sr.ht
gio/patches: FAILED in 20m19s

[Programmatic Click function][0] from [Paulo Melo][1]

[0]: https://lists.sr.ht/~eliasnaur/gio-patches/patches/20011
[1]: mailto:paulo.durrer.melo@gmail.com

✗ #416050 FAILED  gio/patches/linux.yml   https://builds.sr.ht/~eliasnaur/job/416050
✓ #416048 SUCCESS gio/patches/apple.yml   https://builds.sr.ht/~eliasnaur/job/416048
✓ #416051 SUCCESS gio/patches/openbsd.yml https://builds.sr.ht/~eliasnaur/job/416051
✓ #416049 SUCCESS gio/patches/freebsd.yml https://builds.sr.ht/~eliasnaur/job/416049
LGTM. The linux builder failed because your patch is not signed off.
See https://gioui.org/doc/contribute for what signing off a patch means,
and how to instruct git to sign off.

Elias