From 6f05edf78f2c21b928248306126739961b2b47f8 Mon Sep 17 00:00:00 2001 From: Masala Date: Thu, 4 Jul 2024 20:02:05 +0000 Subject: [PATCH] go fmt... --- contact.go | 2 +- home.go | 33 +++++++++++++++++---------------- katzen.go | 2 +- spool.go | 30 +++++++++++++++--------------- 4 files changed, 34 insertions(+), 33 deletions(-) diff --git a/contact.go b/contact.go index a2d9d9c..644ebfe 100644 --- a/contact.go +++ b/contact.go @@ -15,8 +15,8 @@ import ( "gioui.org/widget/material" "github.com/benc-uk/gofract/pkg/colors" "github.com/benc-uk/gofract/pkg/fractals" - "github.com/katzenpost/katzenpost/catshadow" "github.com/katzenpost/hpqc/rand" + "github.com/katzenpost/katzenpost/catshadow" qrcode "github.com/skip2/go-qrcode" "golang.org/x/exp/shiny/materialdesign/icons" "image" diff --git a/home.go b/home.go index f859478..bd34425 100644 --- a/home.go +++ b/home.go @@ -3,12 +3,12 @@ package main import ( "bytes" "encoding/base64" + "gioui.org/font" "gioui.org/gesture" "gioui.org/io/key" "gioui.org/layout" "gioui.org/op/clip" "gioui.org/op/paint" - "gioui.org/font" "gioui.org/unit" "gioui.org/widget" "gioui.org/widget/material" @@ -149,21 +149,22 @@ func (p *HomePage) Layout(gtx layout.Context) layout.Dimensions { }), layout.Rigid(func(gtx C) D { return layout.Flex{Axis: layout.Vertical, Alignment: layout.Start, Spacing: layout.SpaceEnd}.Layout(gtx, - layout.Rigid(func(gtx C) D { - if contacts[i].IsPending { - return pandaIcon.Layout(gtx, th.Palette.ContrastBg) - } - return fill{th.Bg}.Layout(gtx) - }), - layout.Rigid(func(gtx C) D { - // timestamp - if lastMsg != nil { - messageAge := strings.Replace(durafmt.ParseShort(time.Now().Round(0).Sub(lastMsg.Timestamp).Truncate(time.Minute)).Format(units), "0 s", "now", 1) - return material.Caption(th, messageAge).Layout(gtx) - } - return fill{th.Bg}.Layout(gtx) - }), - )}), + layout.Rigid(func(gtx C) D { + if contacts[i].IsPending { + return pandaIcon.Layout(gtx, th.Palette.ContrastBg) + } + return fill{th.Bg}.Layout(gtx) + }), + layout.Rigid(func(gtx C) D { + // timestamp + if lastMsg != nil { + messageAge := strings.Replace(durafmt.ParseShort(time.Now().Round(0).Sub(lastMsg.Timestamp).Truncate(time.Minute)).Format(units), "0 s", "now", 1) + return material.Caption(th, messageAge).Layout(gtx) + } + return fill{th.Bg}.Layout(gtx) + }), + ) + }), ) }), // last message diff --git a/katzen.go b/katzen.go index 344c637..9a68c26 100644 --- a/katzen.go +++ b/katzen.go @@ -17,11 +17,11 @@ import ( _ "gioui.org/app/permission/foreground" _ "gioui.org/app/permission/storage" "gioui.org/font/gofont" - "gioui.org/text" "gioui.org/io/key" "gioui.org/io/system" "gioui.org/layout" "gioui.org/op" + "gioui.org/text" "gioui.org/unit" "gioui.org/widget/material" "gioui.org/x/notify" diff --git a/spool.go b/spool.go index 9481760..cfae3ae 100644 --- a/spool.go +++ b/spool.go @@ -1,30 +1,30 @@ package main import ( + "gioui.org/gesture" "gioui.org/layout" - "time" "gioui.org/op/clip" - "gioui.org/x/notify" - "gioui.org/widget" - "sync" - "image" - "gioui.org/gesture" "gioui.org/unit" + "gioui.org/widget" "gioui.org/widget/material" + "gioui.org/x/notify" "github.com/katzenpost/katzenpost/catshadow" + "image" + "sync" + "time" //"gioui.org/widget/material" ) type SpoolPage struct { - a *App - provider *layout.List + a *App + provider *layout.List providerClicks map[string]*gesture.Click - connect *widget.Clickable - settings *widget.Clickable - back *widget.Clickable - submit *widget.Clickable - once *sync.Once - errCh chan error + connect *widget.Clickable + settings *widget.Clickable + back *widget.Clickable + submit *widget.Clickable + once *sync.Once + errCh chan error } func (p *SpoolPage) Start(stop <-chan struct{}) { @@ -135,7 +135,7 @@ func (p *SpoolPage) Event(gtx layout.Context) interface{} { if e.Type == gesture.TypeClick { provider := provider // copy reference to provider go p.once.Do(func() { - select{ + select { case p.errCh <- p.a.c.CreateRemoteSpoolOn(provider): case <-p.a.c.HaltCh(): return