apps: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-06 09:23:02 +02:00
parent 529fd4d307
commit e7fabcf774
3 changed files with 32 additions and 38 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ module gioui.org/apps
go 1.13 go 1.13
require ( require (
gioui.org v0.0.0-20191005202732-2097c6475da9 gioui.org v0.0.0-20191006072004-529fd4d307e8
github.com/google/go-github/v24 v24.0.1 github.com/google/go-github/v24 v24.0.1
golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f
golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9
+2 -2
View File
@@ -1,6 +1,6 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
gioui.org v0.0.0-20191005202732-2097c6475da9 h1:ussyIS8IC0ekvvIdaltbV1MsHfCCDt4W5HICqRNEQvk= gioui.org v0.0.0-20191006072004-529fd4d307e8 h1:3hGhb8saeDm0LKKL/Zdg8LhGH4CZcz6hHCaGZIRayAs=
gioui.org v0.0.0-20191005202732-2097c6475da9/go.mod h1:+CEjc9B//HrBfWsQOVxjCyih7HGIj3Pww1xFHVDZyyk= gioui.org v0.0.0-20191006072004-529fd4d307e8/go.mod h1:+CEjc9B//HrBfWsQOVxjCyih7HGIj3Pww1xFHVDZyyk=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+29 -35
View File
@@ -235,8 +235,8 @@ func (up *userPage) commit(gtx *layout.Context, index int) {
label := text.Label{Material: theme.text, Size: unit.Sp(12), Text: msg} label := text.Label{Material: theme.text, Size: unit.Sp(12), Text: msg}
in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Left: unit.Dp(8)} in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Left: unit.Dp(8)}
in.Layout(gtx, func() { in.Layout(gtx, func() {
f := (&layout.Flex{Axis: layout.Horizontal}).Init(gtx) f := layout.Flex{Axis: layout.Horizontal}
c1 := f.Rigid(func() { c1 := f.Rigid(gtx, func() {
sz := gtx.Px(unit.Dp(48)) sz := gtx.Px(unit.Dp(48))
cc := clipCircle{} cc := clipCircle{}
cc.Layout(gtx, func() { cc.Layout(gtx, func() {
@@ -244,19 +244,19 @@ func (up *userPage) commit(gtx *layout.Context, index int) {
widget.Image{Src: u.avatar, Rect: u.avatar.Bounds()}.Layout(gtx) widget.Image{Src: u.avatar, Rect: u.avatar.Bounds()}.Layout(gtx)
}) })
}) })
c2 := f.Flexible(1, func() { c2 := f.Flex(gtx, 1, func() {
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
layout.Inset{Left: unit.Dp(8)}.Layout(gtx, func() { layout.Inset{Left: unit.Dp(8)}.Layout(gtx, func() {
label.Layout(gtx, families.primary) label.Layout(gtx, families.primary)
}) })
}) })
f.Layout(c1, c2) f.Layout(gtx, c1, c2)
}) })
} }
func (u *UI) layoutUsers(gtx *layout.Context) { func (u *UI) layoutUsers(gtx *layout.Context) {
st := (&layout.Stack{}).Init(gtx) var st layout.Stack
c2 := st.Rigid(func() { c2 := st.Rigid(gtx, func() {
layout.Align(layout.SE).Layout(gtx, func() { layout.Align(layout.SE).Layout(gtx, func() {
in := layout.UniformInset(unit.Dp(16)) in := layout.UniformInset(unit.Dp(16))
in.Layout(gtx, func() { in.Layout(gtx, func() {
@@ -265,10 +265,10 @@ func (u *UI) layoutUsers(gtx *layout.Context) {
}) })
}) })
c1 := st.Expand(func() { c1 := st.Expand(gtx, func() {
f := (&layout.Flex{Axis: layout.Vertical}).Init(gtx) f := layout.Flex{Axis: layout.Vertical}
c1 := f.Rigid(func() { c1 := f.Rigid(gtx, func() {
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
layout.UniformInset(unit.Dp(16)).Layout(gtx, func() { layout.UniformInset(unit.Dp(16)).Layout(gtx, func() {
sz := gtx.Px(unit.Dp(200)) sz := gtx.Px(unit.Dp(200))
@@ -278,7 +278,7 @@ func (u *UI) layoutUsers(gtx *layout.Context) {
}) })
}) })
c2 := f.Rigid(func() { c2 := f.Rigid(gtx, func() {
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
in := layout.Inset{Bottom: unit.Dp(16), Left: unit.Dp(16), Right: unit.Dp(16)} in := layout.Inset{Bottom: unit.Dp(16), Left: unit.Dp(16), Right: unit.Dp(16)}
in.Layout(gtx, func() { in.Layout(gtx, func() {
@@ -286,11 +286,10 @@ func (u *UI) layoutUsers(gtx *layout.Context) {
}) })
}) })
c3 := f.Rigid(func() { c3 := f.Rigid(gtx, func() {
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
s := layout.Stack{Alignment: layout.Center} s := layout.Stack{Alignment: layout.Center}
s.Init(gtx) c2 := s.Rigid(gtx, func() {
c2 := s.Rigid(func() {
grey := colorMaterial(gtx.Ops, rgb(0x888888)) grey := colorMaterial(gtx.Ops, rgb(0x888888))
in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Bottom: unit.Dp(8), Left: unit.Dp(8)} in := layout.Inset{Top: unit.Dp(16), Right: unit.Dp(8), Bottom: unit.Dp(8), Left: unit.Dp(8)}
in.Layout(gtx, func() { in.Layout(gtx, func() {
@@ -298,25 +297,24 @@ func (u *UI) layoutUsers(gtx *layout.Context) {
lbl.Layout(gtx, families.primary) lbl.Layout(gtx, families.primary)
}) })
}) })
c1 := s.Expand(func() { c1 := s.Expand(gtx, func() {
fill{colorMaterial(gtx.Ops, rgb(0xf2f2f2))}.Layout(gtx) fill{colorMaterial(gtx.Ops, rgb(0xf2f2f2))}.Layout(gtx)
}) })
s.Layout(c1, c2) s.Layout(gtx, c1, c2)
}) })
c4 := f.Flexible(1, func() { c4 := f.Flex(gtx, 1, func() {
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
u.layoutContributors(gtx) u.layoutContributors(gtx)
}) })
f.Layout(c1, c2, c3, c4) f.Layout(gtx, c1, c2, c3, c4)
}) })
st.Layout(c1, c2) st.Layout(gtx, c1, c2)
} }
func (a *ActionButton) Layout(gtx *layout.Context) { func (a *ActionButton) Layout(gtx *layout.Context) {
f := layout.Flex{Axis: layout.Vertical, Alignment: layout.End} f := layout.Flex{Axis: layout.Vertical, Alignment: layout.End}
f.Init(gtx) f.Layout(gtx, f.Rigid(gtx, func() {
f.Layout(f.Rigid(func() {
layout.Inset{Top: unit.Dp(4)}.Layout(gtx, func() { layout.Inset{Top: unit.Dp(4)}.Layout(gtx, func() {
fab(gtx, a.sendIco.image(gtx), theme.brand, gtx.Px(unit.Dp(56))) fab(gtx, a.sendIco.image(gtx), theme.brand, gtx.Px(unit.Dp(56)))
pointer.EllipseAreaOp{Rect: image.Rectangle{Max: gtx.Dimensions.Size}}.Add(gtx.Ops) pointer.EllipseAreaOp{Rect: image.Rectangle{Max: gtx.Dimensions.Size}}.Add(gtx.Ops)
@@ -337,13 +335,11 @@ func (u *UI) layoutContributors(gtx *layout.Context) {
func (u *UI) user(gtx *layout.Context, index int) { func (u *UI) user(gtx *layout.Context, index int) {
user := u.users[index] user := u.users[index]
elem := layout.Flex{Axis: layout.Vertical} elem := layout.Flex{Axis: layout.Vertical}
elem.Init(gtx) c1 := elem.Rigid(gtx, func() {
c1 := elem.Rigid(func() {
in := layout.UniformInset(unit.Dp(8)) in := layout.UniformInset(unit.Dp(8))
in.Layout(gtx, func() { in.Layout(gtx, func() {
f := centerRowOpts() f := centerRowOpts()
f.Init(gtx) c1 := f.Rigid(gtx, func() {
c1 := f.Rigid(func() {
in := layout.Inset{Right: unit.Dp(8)} in := layout.Inset{Right: unit.Dp(8)}
cc := clipCircle{} cc := clipCircle{}
in.Layout(gtx, func() { in.Layout(gtx, func() {
@@ -354,16 +350,14 @@ func (u *UI) user(gtx *layout.Context, index int) {
}) })
}) })
}) })
c2 := f.Rigid(func() { c2 := f.Rigid(gtx, func() {
f := column() f := column()
f.Init(gtx) c1 := f.Rigid(gtx, func() {
c1 := f.Rigid(func() {
f := baseline() f := baseline()
f.Init(gtx) c1 := f.Rigid(gtx, func() {
c1 := f.Rigid(func() {
text.Label{Material: theme.text, Size: unit.Sp(13), Text: user.name}.Layout(gtx, families.primary) text.Label{Material: theme.text, Size: unit.Sp(13), Text: user.name}.Layout(gtx, families.primary)
}) })
c2 := f.Flexible(1, func() { c2 := f.Flex(gtx, 1, func() {
gtx.Constraints.Width.Min = gtx.Constraints.Width.Max gtx.Constraints.Width.Min = gtx.Constraints.Width.Max
layout.Align(layout.E).Layout(gtx, func() { layout.Align(layout.E).Layout(gtx, func() {
layout.Inset{Left: unit.Dp(2)}.Layout(gtx, func() { layout.Inset{Left: unit.Dp(2)}.Layout(gtx, func() {
@@ -372,23 +366,23 @@ func (u *UI) user(gtx *layout.Context, index int) {
}) })
}) })
}) })
f.Layout(c1, c2) f.Layout(gtx, c1, c2)
}) })
c2 := f.Rigid(func() { c2 := f.Rigid(gtx, func() {
in := layout.Inset{Top: unit.Dp(4)} in := layout.Inset{Top: unit.Dp(4)}
in.Layout(gtx, func() { in.Layout(gtx, func() {
text.Label{Material: theme.tertText, Size: unit.Sp(12), Text: user.company}.Layout(gtx, families.primary) text.Label{Material: theme.tertText, Size: unit.Sp(12), Text: user.company}.Layout(gtx, families.primary)
}) })
}) })
f.Layout(c1, c2) f.Layout(gtx, c1, c2)
}) })
f.Layout(c1, c2) f.Layout(gtx, c1, c2)
}) })
pointer.RectAreaOp{Rect: image.Rectangle{Max: gtx.Dimensions.Size}}.Add(gtx.Ops) pointer.RectAreaOp{Rect: image.Rectangle{Max: gtx.Dimensions.Size}}.Add(gtx.Ops)
click := &u.userClicks[index] click := &u.userClicks[index]
click.Add(gtx.Ops) click.Add(gtx.Ops)
}) })
elem.Layout(c1) elem.Layout(gtx, c1)
} }
type fill struct { type fill struct {