diff --git a/cmd/passgo-gui/impl_linux.go b/cmd/passgo-gui/impl_linux.go index 72e1ea3..45f4ce2 100644 --- a/cmd/passgo-gui/impl_linux.go +++ b/cmd/passgo-gui/impl_linux.go @@ -12,6 +12,10 @@ var ( noidLabelText = "No GPG ids available" ) +func init() { + fontSize = 16 +} + func getConfDir() (string, error) { ret, err := app.DataDir() if err != nil { diff --git a/cmd/passgo-gui/main.go b/cmd/passgo-gui/main.go index f083b29..1a1a7d3 100644 --- a/cmd/passgo-gui/main.go +++ b/cmd/passgo-gui/main.go @@ -651,17 +651,17 @@ func eventLoop() { var insName, insValue string genBtn := &SelButton{SelColor: gray} - genBtn.Button = Button{Size: unit.Sp(fontSize), Label: "generate"} + genBtn.Button = Button{Size: unit.Sp(fontSize), Label: "generate", Color: black} symBtn := &SelButton{SelColor: gray} numBtn := &SelButton{SelColor: gray} - symBtn.Button = Button{Size: unit.Sp(fontSize), Label: "@"} - numBtn.Button = Button{Size: unit.Sp(fontSize), Label: "#"} + symBtn.Button = Button{Size: unit.Sp(fontSize), Label: "@", Color: black} + numBtn.Button = Button{Size: unit.Sp(fontSize), Label: "#", Color: black} symBtn.Select() numBtn.Select() lenEd := &widget.Editor{SingleLine: true, Alignment: text.End} lenEd.SetText("15") - lBtn := &Button{Size: unit.Sp(fontSize), Label: "<", Background: gray} - rBtn := &Button{Size: unit.Sp(fontSize), Label: ">", Background: gray} + lBtn := &Button{Size: unit.Sp(fontSize), Label: "<", Color: black, Background: gray} + rBtn := &Button{Size: unit.Sp(fontSize), Label: ">", Color: black, Background: gray} updatePw := func() { if !genBtn.Selected { diff --git a/cmd/passgo-gui/ui.go b/cmd/passgo-gui/ui.go index 7812c4a..21be9dc 100644 --- a/cmd/passgo-gui/ui.go +++ b/cmd/passgo-gui/ui.go @@ -89,8 +89,14 @@ func (b *Button) Layout(gtx C) D { ret := ins.Layout(gtx, func(gtx C) D { return l.Layout(gtx) }) - // Register the click handler for the label area. - stk := clip.Rect(image.Rectangle{Max: ret.Size}).Push(gtx.Ops) + // Register the click handler for the whole button area, not + // just the label: otherwise buttons with short labels (in + // full-width rows, for example) have a tiny tap target. + hit := ret.Size + if hit.X < gtx.Constraints.Max.X { + hit.X = gtx.Constraints.Max.X + } + stk := clip.Rect(image.Rectangle{Max: hit}).Push(gtx.Ops) event.Op(gtx.Ops, b) b.Click.Add(gtx.Ops) stk.Pop() diff --git a/main.go b/main.go index d092bc6..0fffba5 100644 --- a/main.go +++ b/main.go @@ -63,9 +63,9 @@ func GetStore(store *Store) error { } for i := len(id) - 1; i > 0; i-- { if id[i] == '>' { - for j := i-1; j > 0; j-- { + for j := i - 1; j > 0; j-- { if id[j] == '<' { - id = id[j+1:i] + id = id[j+1 : i] } } break