~eliasnaur/gio-example

8d6bccdaac64935eef85189f3c40dbf5d2973eb3 — Egon Elbre 7 months ago d47e645
all: bump gio version

Update 7gui examples to use layout.Spacer.

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

M 7gui/counter/main.go
M 7gui/temperature/main.go
M go.mod
M go.sum
M 7gui/counter/main.go => 7gui/counter/main.go +1 -6
@@ 1,7 1,6 @@
package main

import (
	"image"
	"log"
	"os"
	"strconv"


@@ 125,11 124,7 @@ func (counter *Counter) Layout(th *material.Theme, gtx layout.Context) layout.Di
		}),
		// We use an empty widget to add spacing between the text
		// and the button.
		layout.Rigid(func(gtx layout.Context) layout.Dimensions {
			return layout.Dimensions{
				Size: image.Pt(gtx.Px(defaultMargin), 0),
			}
		}),
		layout.Rigid(layout.Spacer{Height: defaultMargin}.Layout),
		layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
			// For every click on the button increment the count.
			for range counter.increase.Clicks() {

M 7gui/temperature/main.go => 7gui/temperature/main.go +1 -6
@@ 1,7 1,6 @@
package main

import (
	"image"
	"image/color"
	"log"
	"os"


@@ 121,11 120,7 @@ func (conv *Converter) Init() {
// Layout lays out the editors.
func (conv *Converter) Layout(th *material.Theme, gtx layout.Context) layout.Dimensions {
	// We use an empty widget to add spacing between widgets.
	spacer := layout.Rigid(func(gtx layout.Context) layout.Dimensions {
		return layout.Dimensions{
			Size: image.Pt(gtx.Px(defaultMargin), 0),
		}
	})
	spacer := layout.Rigid(layout.Spacer{Width: defaultMargin}.Layout)

	// check whether the celsius value has changed.
	if conv.Celsius.Changed() {

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

require (
	gioui.org v0.0.0-20201209093930-ac14320bec75
	gioui.org v0.0.0-20201209164149-679bf092cb83
	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 -2
@@ 1,7 1,7 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20201209093930-ac14320bec75 h1:1FST5A1zas7HVvV76lJOGqHsksxVz7SSpbL4BdYF+m4=
gioui.org v0.0.0-20201209093930-ac14320bec75/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
gioui.org v0.0.0-20201209164149-679bf092cb83 h1:7JOxhbydBpEBdA4sKAIW9vy+PYcR1KH4U0q74TzugIA=
gioui.org v0.0.0-20201209164149-679bf092cb83/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=