From 3aced19260bfac158f78730b1259cba51b059321 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 9 Jan 2024 08:41:32 -0600 Subject: [PATCH] tag dropdown Signed-off-by: Jeff Carr --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 286995d..f0a6280 100644 --- a/main.go +++ b/main.go @@ -27,6 +27,7 @@ type repo struct { bLabel *gui.Node // branch label lastLabel *gui.Node // last tagged version label vLabel *gui.Node // version label + tagsDrop *gui.Node // list of all tags sLabel *gui.Node // git state (dirty or not?) cButton *gui.Node // commit button @@ -70,6 +71,9 @@ func (r *repo) scan() { r.lastLabel.SetText(out) r.tags = listFiles(fullpath(r.path + "/.git/refs/tags")) + for _, tag := range r.tags { + r.tagsDrop.AddText(tag) + } // cmd := "dig +noall +answer www.wit.com A" // out = shell.Run(cmd) @@ -89,6 +93,7 @@ func addRepo(grid *gui.Node, path string) *repo { newRepo.pLabel = grid.NewLabel(path) newRepo.bLabel = grid.NewLabel("") newRepo.lastLabel = grid.NewLabel("") + newRepo.tagsDrop = grid.NewDropdown("tags") newRepo.vLabel = grid.NewLabel("") newRepo.sLabel = grid.NewLabel("") @@ -109,11 +114,12 @@ func helloworld() { box := win.Box().NewBox("bw vbox", false) group := box.NewGroup("test") - grid := group.NewGrid("test", 7, 1) + grid := group.NewGrid("test", 8, 1) grid.NewLabel("go repo") grid.NewLabel("branch") grid.NewLabel("last tag") + grid.NewLabel("tags") grid.NewLabel("Version") grid.NewLabel("is dirty?") grid.NewLabel("commit")