From 3163a75b9326e32291bdf02591ed64cbecf1c03a Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 18 Dec 2019 13:30:56 -0500 Subject: [PATCH] Update to latest Gio release. Install a system font on Darwin to get access to Unicode glyphs. --- .gitignore | 1 - PgpConnect.jar | Bin 0 -> 6822 bytes cmd/passgo-gui/impl_android.go | 2 + cmd/passgo-gui/impl_darwin.go | 30 ++++++----- cmd/passgo-gui/main.go | 94 ++++++++++++++++----------------- cmd/passgo-gui/ui.go | 10 ++-- go.mod | 3 +- go.sum | 2 + 8 files changed, 74 insertions(+), 68 deletions(-) create mode 100644 PgpConnect.jar diff --git a/.gitignore b/.gitignore index 6327216..2925ed9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ cmd/passgo/passgo cmd/passgo-gui/passgo-gui nohup.out *.apk -PgpConnect.jar diff --git a/PgpConnect.jar b/PgpConnect.jar new file mode 100644 index 0000000000000000000000000000000000000000..49b2af49ac24ee86d530c7e89a7e517057513241 GIT binary patch literal 6822 zcmbuDWl&sMw}#Q+8VK$Z9D+N+-CYwJm&P3e!J%>2K%jwOjk`Mp*CbeIAV46&8i$Zv zn3+4t%>8D*A9q!qs(tFL_dR>>T5H!ikA^ZL5&;}4Dk_{XFj*b$mq3FV{%kz`j? zljHn83I~S>r=g63dY^&tN1DbziV5yA{uHZ9swv9JYU^;Q%AKf=kEtlLbIf2Vv$IT& zPt|L2&GSIF+&Gj}*%Vc0Jj;>L3_g<#kY$rF+g=heFzytw2<{LOej;K>hg)!fxgEQ~ z|27LqMoq2E-8*FOuKQV_!@=Fn?C(oJynE{I!THY#D8DCoJA40262{LY8@qpV!~bid zi@CeIjq`8D|9OY$|8u^Li?p+ola+-B{Syug$2*fWZJ_!?N!-9D_LVbHW4M>+;_O3RM!J~cq~ANrH!>s-U}x$ z>+_q0sWrIqb+1R#OhX$X!Q_m5CcKH!o{Gc8A37>6l%x&i89wS_#ez%BjigOO2NPEt zZWwG#6$X2x&`%RyE*J z{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%#;?!D-AA9TZhX=;b&did-JbXh4c>}3?>GT7 zu523>jL&W%Z!|U~LI*=3zVm8@2L$Oy3t}Jk%!H$@-qfrF;iT`>_O0!iWkv3oR|m zvB=xT2rOR{epT3D`V#RWb0t&<|5CYQ&C4xL_2`V(7=~1ik;r{E22s-TdGIPU@KFP6 z0+6B60QqtC1B+3qO~=Z06%(}~2wkToWg0FY`DXRe`*Q_ zS_Lh+CqVRl4Qt6rRl+*|ikciD$YTU_M3s3f5ADM;03`s#JcW-EhGi7lrT}MB~UCUAzc-c!hw;a(OgcFGyvdHH8i?g3?t3c9k9k^%HpH zTOV<>1!nJd&+Szo*i!ZnaPp7jJW_AN}~x3{1B5F7k5>(B6(#MQoVx|;i^YKY05OGvil6*X7SuJN2+67>3I zyS#`q%PT$;II==GBj~b|Y?PKFIV_H-mAY`ttkI8}3CI`XY>F5hg4iEARn( za^v9&%IYY?4#)ZcQ5Yz)9WG!0=bPg zPZqFQGuMyjHwYdx(?cNPp|^EMbHFu`{q~HWfFwBb9>ZS5Q>x#78u_Y00b5vbaJl67 zcmp1R0Pe3e`tE=7x47s1e~mu@{yqKwyYyEAe^2{=hS=TkPw6l0|K0%|?w?8hPlx`y z;cwjjp9S~i{%3r;8{P?i=lK6Dx+nQR0}cL9(eGUUpN02i|7URjRrn|8|LflV3R>@R z>dyfDXZ`=-{(s-{UqRJh9dGY|z#r?sU&{Z^=%?c!xc2XkzXFB7I^x`I@V`3#fxG_h k_-nP@gNUEeiuUi0zhemvW#k9 0 { // still zero after update for i := 0; i < len(idBtns); i++ { lst.Layout(gtx, len(idBtns), func(i int) { @@ -597,34 +597,34 @@ func eventLoop() { } insertPage = func() { - c2 := flex.Rigid(gtx, func() { insertLabel.Layout(gtx) }) - c3 := flex.Rigid(gtx, func() { passnameLabel.Layout(gtx) }) - c4 := flex.Rigid(gtx, func() { th.Editor("name").Layout(gtx, passnameEd) }) - c5 := flex.Rigid(gtx, func() { passvalLabel.Layout(gtx) }) - c6 := flex.Rigid(gtx, func() { th.Editor("password").Layout(gtx, passvalEd) }) + c2 := layout.Rigid(func() { insertLabel.Layout(gtx) }) + c3 := layout.Rigid(func() { passnameLabel.Layout(gtx) }) + c4 := layout.Rigid(func() { th.Editor("name").Layout(gtx, passnameEd) }) + c5 := layout.Rigid(func() { passvalLabel.Layout(gtx) }) + c6 := layout.Rigid(func() { th.Editor("password").Layout(gtx, passvalEd) }) btnflx := &layout.Flex{Axis: layout.Horizontal} al := layout.Align(layout.E) - c7 := flex.Rigid(gtx, func() { - bc1 := btnflx.Rigid(gtx, func() { lBtn.Layout(gtx) }) - bc2 := btnflx.Rigid(gtx, func() { + c7 := layout.Rigid(func() { + bc1 := layout.Rigid(func() { lBtn.Layout(gtx) }) + bc2 := layout.Rigid(func() { gtx.Constraints.Width.Min = 60 th.Editor("len").Layout(gtx, lenEd) }) - bc3 := btnflx.Rigid(gtx, func() { rBtn.Layout(gtx) }) - bc4 := btnflx.Rigid(gtx, func() { symBtn.Layout(gtx) }) - bc5 := btnflx.Rigid(gtx, func() { numBtn.Layout(gtx) }) - bc6 := btnflx.Rigid(gtx, func() { genBtn.Layout(gtx) }) + bc3 := layout.Rigid(func() { rBtn.Layout(gtx) }) + bc4 := layout.Rigid(func() { symBtn.Layout(gtx) }) + bc5 := layout.Rigid(func() { numBtn.Layout(gtx) }) + bc6 := layout.Rigid(func() { genBtn.Layout(gtx) }) al.Layout(gtx, func() { btnflx.Layout(gtx, bc1, bc2, bc3, bc4, bc5, bc6) }) }) - c8 := flex.Rigid(gtx, func() { - bc1 := btnflx.Rigid(gtx, func() { backBtn.Layout(gtx) }) - bc2 := btnflx.Rigid(gtx, func() { saveBtn.Layout(gtx) }) + c8 := layout.Rigid(func() { + bc1 := layout.Rigid(func() { backBtn.Layout(gtx) }) + bc2 := layout.Rigid(func() { saveBtn.Layout(gtx) }) al.Layout(gtx, func() { btnflx.Layout(gtx, bc1, bc2) }) @@ -687,14 +687,14 @@ func eventLoop() { } confirmPage = func() { - c2 := flex.Rigid(gtx, func() { + c2 := layout.Rigid(func() { confirmLabel.Layout(gtx) }) al := layout.Align(layout.E) btnflx := &layout.Flex{Axis: layout.Horizontal} - c3 := flex.Rigid(gtx, func() { - bc1 := btnflx.Rigid(gtx, func() { backBtn.Layout(gtx) }) - bc2 := btnflx.Rigid(gtx, func() { yesBtn.Layout(gtx) }) + c3 := layout.Rigid(func() { + bc1 := layout.Rigid(func() { backBtn.Layout(gtx) }) + bc2 := layout.Rigid(func() { yesBtn.Layout(gtx) }) al.Layout(gtx, func() { btnflx.Layout(gtx, bc1, bc2) @@ -719,16 +719,16 @@ func eventLoop() { } confPage = func() { - c2 := flex.Rigid(gtx, func() { storeDirLabel.Layout(gtx) }) - c3 := flex.Rigid(gtx, func() { th.Editor("directory").Layout(gtx, storeDirEd) }) + c2 := layout.Rigid(func() { storeDirLabel.Layout(gtx) }) + c3 := layout.Rigid(func() { th.Editor("directory").Layout(gtx, storeDirEd) }) al := layout.Align(layout.E) - c4 := flex.Rigid(gtx, func() { + c4 := layout.Rigid(func() { btnflx := &layout.Flex{Axis: layout.Horizontal} - bc1 := btnflx.Rigid(gtx, func() { + bc1 := layout.Rigid(func() { backBtn.Layout(gtx) }) - bc2 := btnflx.Rigid(gtx, func() { + bc2 := layout.Rigid(func() { saveBtn.Layout(gtx) }) al.Layout(gtx, func() { @@ -768,15 +768,15 @@ func eventLoop() { submit = true } } - c2 := flex.Rigid(gtx, func() { promptLabel.Layout(gtx) }) - c3 := flex.Rigid(gtx, func() { th.Editor("password").Layout(gtx, promptEd) }) - c4 := flex.Rigid(gtx, func() { + c2 := layout.Rigid(func() { promptLabel.Layout(gtx) }) + c3 := layout.Rigid(func() { th.Editor("password").Layout(gtx, promptEd) }) + c4 := layout.Rigid(func() { al := layout.Align(layout.E) btnflx := &layout.Flex{Axis: layout.Horizontal} - bc1 := btnflx.Rigid(gtx, func() { + bc1 := layout.Rigid(func() { backBtn.Layout(gtx) }) - bc2 := btnflx.Rigid(gtx, func() { + bc2 := layout.Rigid(func() { okBtn.Layout(gtx) }) al.Layout(gtx, func() { @@ -842,14 +842,14 @@ func eventLoop() { sysinset.Layout(gtx, func() { margin.Layout(gtx, func() { margincs = gtx.Constraints - c1 = flex.Rigid(gtx, func() { - ct2 := titleflex.Rigid(gtx, func() { + c1 = layout.Rigid(func() { + ct2 := layout.Rigid(func() { plusBtn.Layout(gtx) }) - ct3 := titleflex.Rigid(gtx, func() { + ct3 := layout.Rigid(func() { dotsBtn.Layout(gtx) }) - ct1 := titleflex.Flex(gtx, 1.0, func() { + ct1 := layout.Flexed(1.0, func() { gtx.Constraints.Width.Min = gtx.Constraints.Width.Max title.Layout(gtx) }) diff --git a/cmd/passgo-gui/ui.go b/cmd/passgo-gui/ui.go index 964fd5f..520e4d2 100644 --- a/cmd/passgo-gui/ui.go +++ b/cmd/passgo-gui/ui.go @@ -34,7 +34,7 @@ func (b *Overlay) Layout(gtx *layout.Context) { ins := layout.UniformInset(unit.Dp(1)) ins.Layout(gtx, func() { st := layout.Stack{} - c2 := st.Rigid(gtx, func() { + c2 := layout.Stacked(func() { l := th.Label(b.Size, b.Text) ins := layout.UniformInset(unit.Dp(4)) l.Color = b.Color @@ -43,7 +43,7 @@ func (b *Overlay) Layout(gtx *layout.Context) { }) pointer.Rect(image.Rect(0, 0, gtx.Dimensions.Size.X, gtx.Dimensions.Size.Y)).Add(gtx.Ops) }) - c1 := st.Expand(gtx, func() { + c1 := layout.Expanded(func() { layoutRRect(b.Background, gtx) }) st.Layout(gtx, c1, c2) @@ -67,7 +67,7 @@ type Button struct { } func layoutRRect(col color.RGBA, gtx *layout.Context) { - r := float32(gtx.Config.Px(unit.Dp(4))) + r := float32(gtx.Px(unit.Dp(4))) sz := image.Point{X: gtx.Constraints.Width.Min, Y: gtx.Constraints.Height.Min} w, h := float32(sz.X), float32(sz.Y) rect := f32.Rectangle{ @@ -92,7 +92,7 @@ func (b *Button) Layout(gtx *layout.Context) { ins := layout.UniformInset(unit.Dp(1)) ins.Layout(gtx, func() { st := layout.Stack{} - c2 := st.Rigid(gtx, func() { + c2 := layout.Stacked(func() { l := th.Label(b.Size, b.Label) ins := layout.UniformInset(unit.Dp(4)) //paint.ColorOp{Color: b.Color}.Add(ops) @@ -102,7 +102,7 @@ func (b *Button) Layout(gtx *layout.Context) { pointer.Rect(image.Rect(0, 0, gtx.Dimensions.Size.X, gtx.Dimensions.Size.Y)).Add(gtx.Ops) b.Click.Add(gtx.Ops) }) - c1 := st.Expand(gtx, func() { + c1 := layout.Expanded(func() { gtx.Constraints.Width.Min = mwidth layoutRRect(b.Background, gtx) }) diff --git a/go.mod b/go.mod index 754562d..79b8e47 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,12 @@ module git.wow.st/gmp/passgo go 1.13 require ( - gioui.org v0.0.0-20191126175243-2ca2e5462f16 + gioui.org v0.0.0-20191218180754-3dd7c8121c67 git.wow.st/gmp/clip v0.0.0-20191001134149-1458ba6a7cf5 git.wow.st/gmp/rand v0.0.0-20191001220155-a81bebfaf8b0 github.com/fsnotify/fsnotify v1.4.7 github.com/jcmdev0/gpgagent v0.0.0-20180509014935-5601b32d936c golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c + golang.org/x/image v0.0.0-20190802002840-cff245a6509b gopkg.in/yaml.v2 v2.2.7 ) diff --git a/go.sum b/go.sum index 76854e2..a6af5d7 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20191126175243-2ca2e5462f16 h1:p31rtmKm51xpj2QtqGNlljAyHEP1oStU8MDRl2Dv7Gs= gioui.org v0.0.0-20191126175243-2ca2e5462f16/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY= +gioui.org v0.0.0-20191218180754-3dd7c8121c67 h1:y9md+l1thtMqJu/ulhF1Upv3pnOpGotpJDssO8X3LbY= +gioui.org v0.0.0-20191218180754-3dd7c8121c67/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY= git.wow.st/gmp/clip v0.0.0-20191001134149-1458ba6a7cf5 h1:OKeTjZST+/TKvtdA258NXJH+/gIx/xwyZxKrAezNFvk= git.wow.st/gmp/clip v0.0.0-20191001134149-1458ba6a7cf5/go.mod h1:NLdpaBoMQNFqncwP8OVRNWUDw1Kt9XWm3snfT7cXu24= git.wow.st/gmp/rand v0.0.0-20191001220155-a81bebfaf8b0 h1:08wP00wvbDINsct1fzKV1xGGLvvtNsSb2X4CtIdpBzM=