cmd/tailscale: bump gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/2/head
Elias Naur 5 years ago
parent 5a6626d1e6
commit 920aba4ff1

@ -264,9 +264,7 @@ type Dismiss struct {
} }
func (d *Dismiss) Add(gtx layout.Context) { func (d *Dismiss) Add(gtx layout.Context) {
var stack op.StackOp defer op.Push(gtx.Ops).Pop()
stack.Push(gtx.Ops)
defer stack.Pop()
pointer.Rect(image.Rectangle{Max: gtx.Constraints.Min}).Add(gtx.Ops) pointer.Rect(image.Rectangle{Max: gtx.Constraints.Min}).Add(gtx.Ops)
pointer.InputOp{Tag: d}.Add(gtx.Ops) pointer.InputOp{Tag: d}.Add(gtx.Ops)
} }
@ -453,8 +451,7 @@ func (ui *UI) layoutMenu(gtx layout.Context, sysIns system.Insets, expiry time.T
f := layout.Flex{Axis: layout.Vertical} f := layout.Flex{Axis: layout.Vertical}
// First pass: record and discard operations // First pass: record and discard operations
// and determine widest item. // and determine widest item.
var m op.MacroOp m := op.Record(gtx.Ops)
m.Record(gtx.Ops)
f.Layout(gtx, children...) f.Layout(gtx, children...)
m.Stop() m.Stop()
// Second pass: layout items with equal width. // Second pass: layout items with equal width.
@ -689,13 +686,11 @@ func drawLogo(ops *op.Ops, size int) {
tx := op.TransformOp{}.Offset(f32.Pt(off, 0)) tx := op.TransformOp{}.Offset(f32.Pt(off, 0))
ty := op.TransformOp{}.Offset(f32.Pt(0, off)) ty := op.TransformOp{}.Offset(f32.Pt(0, off))
var st op.StackOp st := op.Push(ops)
st.Push(ops)
defer st.Pop() defer st.Pop()
var row op.StackOp
// First row of discs. // First row of discs.
row.Push(ops) row := op.Push(ops)
drawDisc(ops, discDia, rgb(0x54514d)) drawDisc(ops, discDia, rgb(0x54514d))
tx.Add(ops) tx.Add(ops)
drawDisc(ops, discDia, rgb(0x54514d)) drawDisc(ops, discDia, rgb(0x54514d))
@ -705,7 +700,7 @@ func drawLogo(ops *op.Ops, size int) {
ty.Add(ops) ty.Add(ops)
// Second row. // Second row.
row.Push(ops) row = op.Push(ops)
drawDisc(ops, discDia, rgb(0xfffdfa)) drawDisc(ops, discDia, rgb(0xfffdfa))
tx.Add(ops) tx.Add(ops)
drawDisc(ops, discDia, rgb(0xfffdfa)) drawDisc(ops, discDia, rgb(0xfffdfa))
@ -715,7 +710,7 @@ func drawLogo(ops *op.Ops, size int) {
ty.Add(ops) ty.Add(ops)
// Third row. // Third row.
row.Push(ops) row = op.Push(ops)
drawDisc(ops, discDia, rgb(0x54514d)) drawDisc(ops, discDia, rgb(0x54514d))
tx.Add(ops) tx.Add(ops)
drawDisc(ops, discDia, rgb(0xfffdfa)) drawDisc(ops, discDia, rgb(0xfffdfa))
@ -725,9 +720,7 @@ func drawLogo(ops *op.Ops, size int) {
} }
func drawDisc(ops *op.Ops, radius float32, col color.RGBA) { func drawDisc(ops *op.Ops, radius float32, col color.RGBA) {
var st op.StackOp defer op.Push(ops).Pop()
st.Push(ops)
defer st.Pop()
r2 := radius * .5 r2 := radius * .5
dr := f32.Rectangle{Max: f32.Pt(radius, radius)} dr := f32.Rectangle{Max: f32.Pt(radius, radius)}
clip.Rect{ clip.Rect{
@ -746,11 +739,10 @@ type Background struct {
} }
func (b Background) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions { func (b Background) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
var m op.MacroOp m := op.Record(gtx.Ops)
m.Record(gtx.Ops)
dims := w(gtx) dims := w(gtx)
sz := dims.Size sz := dims.Size
m.Stop() call := m.Stop()
// Clip corners, if any. // Clip corners, if any.
if r := gtx.Px(b.CornerRadius); r > 0 { if r := gtx.Px(b.CornerRadius); r > 0 {
rr := float32(r) rr := float32(r)
@ -763,7 +755,7 @@ func (b Background) Layout(gtx layout.Context, w layout.Widget) layout.Dimension
}.Op(gtx.Ops).Add(gtx.Ops) }.Op(gtx.Ops).Add(gtx.Ops)
} }
fill{b.Color}.Layout(gtx, sz) fill{b.Color}.Layout(gtx, sz)
m.Add() call.Add(gtx.Ops)
return dims return dims
} }
@ -772,9 +764,7 @@ type fill struct {
} }
func (f fill) Layout(gtx layout.Context, sz image.Point) layout.Dimensions { func (f fill) Layout(gtx layout.Context, sz image.Point) layout.Dimensions {
var st op.StackOp defer op.Push(gtx.Ops).Pop()
st.Push(gtx.Ops)
defer st.Pop()
dr := f32.Rectangle{Max: layout.FPt(sz)} dr := f32.Rectangle{Max: layout.FPt(sz)}
paint.ColorOp{Color: f.col}.Add(gtx.Ops) paint.ColorOp{Color: f.col}.Add(gtx.Ops)
paint.PaintOp{Rect: dr}.Add(gtx.Ops) paint.PaintOp{Rect: dr}.Add(gtx.Ops)

@ -3,7 +3,7 @@ module tailscale.com/tailscale-android
go 1.14 go 1.14
require ( require (
gioui.org v0.0.0-20200531220444-28bf9e200143 gioui.org v0.0.0-20200602143738-d489c20b8421
gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039 gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039
github.com/tailscale/wireguard-go v0.0.0-20200515231107-62868271d710 github.com/tailscale/wireguard-go v0.0.0-20200515231107-62868271d710
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3 golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3

@ -1,8 +1,8 @@
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=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20200530124200-1377bea3cdc5/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= gioui.org v0.0.0-20200530124200-1377bea3cdc5/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org v0.0.0-20200531220444-28bf9e200143 h1:B3j67PQaeCzLlleL3ZZgkYgGamJEsGBOqqXsoJ7YgJE= gioui.org v0.0.0-20200602143738-d489c20b8421 h1:/NywuUDhhmCUQfB7CnxS7TQZ9Fid5rQaBbhy6rv1FYM=
gioui.org v0.0.0-20200531220444-28bf9e200143/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= gioui.org v0.0.0-20200602143738-d489c20b8421/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039 h1:mO1CTk+PwcDQGMXpN1JJiFflYBvwqSQ6+3Gvp64IKHo= gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039 h1:mO1CTk+PwcDQGMXpN1JJiFflYBvwqSQ6+3Gvp64IKHo=
gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039/go.mod h1:B1g+HOceSj7g3S4Yao3skwInTpcK978KANys5YuapMc= gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039/go.mod h1:B1g+HOceSj7g3S4Yao3skwInTpcK978KANys5YuapMc=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=

Loading…
Cancel
Save