cmd/tailscale: dim want-running switch when not authorized

Updates tailscale/tailscale#420

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/2/head
Elias Naur 4 years ago
parent ab06e659eb
commit adb6bb736b

@ -439,7 +439,7 @@ func (a *App) runUI() error {
case system.DestroyEvent:
return e.Err
case system.FrameEvent:
gtx := layout.NewContext(&ops, e.Queue, e.Config, e.Size)
gtx := layout.NewContext(&ops, e)
events := ui.layout(gtx, e.Insets, state)
e.Frame(gtx.Ops)
a.processUIEvents(w, events, peer, state)

@ -469,7 +469,7 @@ func (ui *UI) layoutMessage(gtx layout.Context, sysIns system.Insets) layout.Dim
if s == "" {
return D{}
}
now := gtx.Now()
now := gtx.Now
d := now.Sub(ui.message.t0)
rem := 4*time.Second - d
if rem < 0 {
@ -491,7 +491,7 @@ func (ui *UI) layoutMessage(gtx layout.Context, sysIns system.Insets) layout.Dim
func (ui *UI) showMessage(gtx layout.Context, msg string) {
ui.message.text = msg
ui.message.t0 = gtx.Now()
ui.message.t0 = gtx.Now
op.InvalidateOp{}.Add(gtx.Ops)
}
@ -567,7 +567,11 @@ func (ui *UI) layoutTop(gtx layout.Context, sysIns system.Insets, state *Network
layout.Rigid(func(gtx C) D {
return in.Layout(gtx, func(gtx C) D {
sw := material.Switch(ui.theme, &ui.enabled)
sw.Color = rgb(white)
sw.Color.Enabled = rgb(white)
if state.State < ipn.Stopped {
sw.Color.Enabled = rgb(0xbbbbbb)
sw.Color.Disabled = rgb(0xbbbbbb)
}
return sw.Layout(gtx)
})
}),

@ -3,7 +3,7 @@ module tailscale.com/tailscale-android
go 1.14
require (
gioui.org v0.0.0-20200609202943-a24a2c9fb6a5
gioui.org v0.0.0-20200610182036-5fe3785bbd88
gioui.org/cmd v0.0.0-20200530141830-d2c67cdf8039
github.com/tailscale/wireguard-go v0.0.0-20200515231107-62868271d710
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=
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-20200609202943-a24a2c9fb6a5 h1:+TQcTYc42g7IkeCH5uyzmxK/fhZws2qjKvzwIE6Rfxg=
gioui.org v0.0.0-20200609202943-a24a2c9fb6a5/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org v0.0.0-20200610182036-5fe3785bbd88 h1:hZP3B7SMDTNb4/+A9Nbqgau2tw6B2+D8ctirTYxsmvA=
gioui.org v0.0.0-20200610182036-5fe3785bbd88/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/go.mod h1:B1g+HOceSj7g3S4Yao3skwInTpcK978KANys5YuapMc=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=

Loading…
Cancel
Save