~eliasnaur/gio-example

a56563fa1cb6380fba15f34e2fe6660f9c1b3c52 — Chris Waldon a month ago 57fec8c
deps,markdown: update to latest gio-x API

This commit updates to the recent changes in the richtext package's
public API.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
3 files changed, 7 insertions(+), 3 deletions(-)

M go.mod
M go.sum
M markdown/main.go
M go.mod => go.mod +1 -1
@@ 5,7 5,7 @@ go 1.17
require (
	gioui.org v0.0.0-20220807212605-65a4366e4468
	gioui.org/cmd v0.0.0-20211103131231-1d0769ae89a5
	gioui.org/x v0.0.0-20220803202424-02a5084a3ebd
	gioui.org/x v0.0.0-20220812201728-6e5ccb802ed1
	github.com/go-gl/gl v0.0.0-20210315015930-ae072cafe09d
	github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210311203641-62640a716d48
	github.com/google/go-github/v24 v24.0.1

M go.sum => go.sum +2 -0
@@ 55,6 55,8 @@ gioui.org/x v0.0.0-20220606121947-8732bd398e12 h1:r4j13mgOtjajMWtQj52MJBoa84uRkW
gioui.org/x v0.0.0-20220606121947-8732bd398e12/go.mod h1:8XMNUPk+xNpfAHkIGWcHGTfXjtdcyA1hxsWGmF9gogU=
gioui.org/x v0.0.0-20220803202424-02a5084a3ebd h1:DATWEhL4YJs73tMeC1cgXS70XJU7Xas/tM5acH5EQT0=
gioui.org/x v0.0.0-20220803202424-02a5084a3ebd/go.mod h1:0apkSvH2FYyzQyIxgGpp9JgFI/3+plcgKXeI9dLSOSU=
gioui.org/x v0.0.0-20220812201728-6e5ccb802ed1 h1:+R1nar5r/WgYNxUInuqX1seYAjn/xxZUuL2QHZ6L9yA=
gioui.org/x v0.0.0-20220812201728-6e5ccb802ed1/go.mod h1:0apkSvH2FYyzQyIxgGpp9JgFI/3+plcgKXeI9dLSOSU=
git.wow.st/gmp/jni v0.0.0-20200827154156-014cd5c7c4c0/go.mod h1:+axXBRUTIDlCeE73IKeD/os7LoEnTKdkp8/gQOFjqyo=
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0 h1:bGG/g4ypjrCJoSvFrP5hafr9PPB5aw8SjcOWWila7ZI=
git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0/go.mod h1:+axXBRUTIDlCeE73IKeD/os7LoEnTKdkp8/gQOFjqyo=

M markdown/main.go => markdown/main.go +4 -2
@@ 115,7 115,7 @@ func (ui *UI) Update(gtx C) {
		for _, e := range events {
			switch e.Type {
			case richtext.Click:
				if url := o.Get(markdown.MetadataURL); url != "" {
				if url, ok := o.Get(markdown.MetadataURL).(string); ok && url != "" {
					if err := giohyperlink.Open(url); err != nil {
						// TODO(jfm): display UI element explaining the error to the user.
						log.Printf("error: opening hyperlink: %v", err)


@@ 124,7 124,9 @@ func (ui *UI) Update(gtx C) {
			case richtext.Hover:
			case richtext.LongPress:
				log.Println("longpress")
				ui.Window.Option(app.Title(o.Get(markdown.MetadataURL)))
				if url, ok := o.Get(markdown.MetadataURL).(string); ok && url != "" {
					ui.Window.Option(app.Title(url))
				}
			}
		}
	}