~eliasnaur/gio-example

7e87532b7f5efe73800b5fde93497330e4e083a0 — Egon Elbre 7 months ago c4d9609
all: bump gio version

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
4 files changed, 11 insertions(+), 9 deletions(-)

M 7gui/timer/main.go
M go.mod
M go.sum
M kitchen/kitchen.go
M 7gui/timer/main.go => 7gui/timer/main.go +3 -3
@@ 125,11 125,11 @@ func (ui *UI) Layout(gtx layout.Context) layout.Dimensions {

	// get the latest information about the timer.
	info := ui.Timer.Info()
	progress := 0
	progress := float32(0)
	if info.Duration == 0 {
		progress = 100
		progress = 1
	} else {
		progress = int(info.Progress * 100 / info.Duration)
		progress = float32(info.Progress.Seconds() / info.Duration.Seconds())
	}

	// inset is used to add padding around the window border.

M go.mod => go.mod +1 -1
@@ 3,7 3,7 @@ module gioui.org/example
go 1.13

require (
	gioui.org v0.0.0-20201209164149-679bf092cb83
	gioui.org v0.0.0-20201211172859-bd7bb4d5d2f3
	github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
	github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72
	github.com/google/go-github/v24 v24.0.1

M go.sum => go.sum +2 -0
@@ 2,6 2,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20201209164149-679bf092cb83 h1:7JOxhbydBpEBdA4sKAIW9vy+PYcR1KH4U0q74TzugIA=
gioui.org v0.0.0-20201209164149-679bf092cb83/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
gioui.org v0.0.0-20201211172859-bd7bb4d5d2f3 h1:MeGkzCHegIlIebxPbC+I1xwNQ7vjTYPxZQ6lzrJydSg=
gioui.org v0.0.0-20201211172859-bd7bb4d5d2f3/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=

M kitchen/kitchen.go => kitchen/kitchen.go +5 -5
@@ 54,7 54,7 @@ func main() {
		log.Fatal(err)
	}
	icon = ic
	progressIncrementer = make(chan int)
	progressIncrementer = make(chan float32)
	if *screenshot != "" {
		if err := saveScreenshot(*screenshot); err != nil {
			fmt.Fprintf(os.Stderr, "failed to save screenshot: %v\n", err)


@@ 66,7 66,7 @@ func main() {
	go func() {
		for {
			time.Sleep(time.Second)
			progressIncrementer <- 10
			progressIncrementer <- 0.1
		}
	}()



@@ 138,7 138,7 @@ func loop(w *app.Window) error {
			}
		case p := <-progressIncrementer:
			progress += p
			if progress > 100 {
			if progress > 1 {
				progress = 0
			}
			w.Invalidate()


@@ 186,8 186,8 @@ var (
	list              = &layout.List{
		Axis: layout.Vertical,
	}
	progress            = 0
	progressIncrementer chan int
	progress            = float32(0)
	progressIncrementer chan float32
	green               = true
	topLabel            = "Hello, Gio"
	icon                *widget.Icon