diff --git a/cmd/passgo-gui/main.go b/cmd/passgo-gui/main.go index 3f788b4..69a3d27 100644 --- a/cmd/passgo-gui/main.go +++ b/cmd/passgo-gui/main.go @@ -326,6 +326,13 @@ func eventLoop() { Color: black, Background: gray, } + backBtn := &Button{ + Face: face, + Label: "back", + Alignment: text.End, + Color: black, + Background: gray, + } anim := &time.Ticker{} animating := false @@ -422,9 +429,21 @@ func eventLoop() { cs = flex.Rigid() al := &layout.Align{Alignment: layout.E} cs = al.Begin(ops, cs) - dims = saveBtn.Layout(c, q, ops, cs) + btnflx := &layout.Flex{Axis: layout.Horizontal} + btnflx.Init(ops, cs) + cs = btnflx.Rigid() + bc1 := btnflx.End(backBtn.Layout(c, q, ops, cs)) + cs = btnflx.Rigid() + bc2 := btnflx.End(saveBtn.Layout(c, q, ops, cs)) + dims = btnflx.Layout(bc1, bc2) c4 := flex.End(al.End(dims)) flex.Layout(c1, c2, c3, c4) + if backBtn.Clicked() { + log(Info, "Back") + storeDirEd.SetText(store.Dir) + w.Invalidate() + page = listPage + } if saveBtn.Clicked() { log(Info, "Save") go func() { // do not block UI thread @@ -434,6 +453,7 @@ func eventLoop() { saveConf() reload <- struct{}{} }() + w.Invalidate() page = listPage } }