diff --git a/example/go.mod b/example/go.mod index 76003829..859c6d2f 100644 --- a/example/go.mod +++ b/example/go.mod @@ -3,7 +3,7 @@ module gioui.org/example go 1.13 require ( - gioui.org v0.0.0-20200503190452-8d9612f9aa46 + gioui.org v0.0.0-20200505083831-26da49e145f3 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 diff --git a/example/go.sum b/example/go.sum index 7d49141a..58a57a6a 100644 --- a/example/go.sum +++ b/example/go.sum @@ -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-20200503190452-8d9612f9aa46 h1:7OFSBlHlymqJPrX54xUKnattrlsTxmVbTZwtFbG+kgU= -gioui.org v0.0.0-20200503190452-8d9612f9aa46/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= +gioui.org v0.0.0-20200505083831-26da49e145f3 h1:cWBPA7uPLhrfO3AfRaD2YwsURnANl5zfR6j1N5Vv58U= +gioui.org v0.0.0-20200505083831-26da49e145f3/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= 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= diff --git a/example/kitchen/kitchen.go b/example/kitchen/kitchen.go index e43eec1b..5b914958 100644 --- a/example/kitchen/kitchen.go +++ b/example/kitchen/kitchen.go @@ -141,7 +141,8 @@ var ( green = true topLabel = "Hello, Gio" icon *widget.Icon - checkbox = new(widget.CheckBox) + checkbox = new(widget.Bool) + swtch = new(widget.Bool) ) func (b iconAndTextButton) Layout(gtx *layout.Context, button *widget.Button, icon *widget.Icon, word string) { @@ -227,7 +228,16 @@ func kitchen(gtx *layout.Context, th *material.Theme) { material.ProgressBar(th).Layout(gtx, progress) }, func() { - material.CheckBox(th, "Checkbox").Layout(gtx, checkbox) + layout.Flex{Alignment: layout.Middle}.Layout(gtx, + layout.Rigid(func() { + material.CheckBox(th, "Checkbox").Layout(gtx, checkbox) + }), + layout.Rigid(func() { + layout.Inset{Left: unit.Dp(16)}.Layout(gtx, func() { + material.Switch(th).Layout(gtx, swtch) + }) + }), + ) }, func() { layout.Flex{}.Layout(gtx,