diff options
| author | Jeff Carr <[email protected]> | 2024-01-09 15:34:53 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-09 15:34:53 -0600 |
| commit | 87346d9452b38db517e76e070f11928060bc2b99 (patch) | |
| tree | 2e6ff93e368fda0a1581496985798fe4c1de3569 /draw.go | |
initial commit
Diffstat (limited to 'draw.go')
| -rw-r--r-- | draw.go | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -0,0 +1,48 @@ +package repostatus + +import ( + "go.wit.com/log" + "go.wit.com/gui/gadgets" +) + +// creates the actual widgets. +// it's assumed you are always passing in a box +func draw(rs *RepoStatus) { + if ! rs.Ready() {return} + rs.group = rs.window.Box().NewGroup("What GO Knows It Has") + + rs.grid = rs.group.NewGrid("gridnuts", 2, 2) + + rs.grid.SetNext(1,1) + + rs.path = gadgets.NewOneLiner(rs.grid, "path") + rs.currentBranch = gadgets.NewOneLiner(rs.grid, "branch") + rs.lasttag = gadgets.NewOneLiner(rs.grid, "last tag") + rs.currentVersion = gadgets.NewOneLiner(rs.grid, "Version") + + rs.grid.NewLabel("tags") + rs.tagsDrop = rs.grid.NewDropdown("tags") + rs.masterBranch = gadgets.NewOneLiner(rs.grid, "master") + rs.develBranch = gadgets.NewOneLiner(rs.grid, "devel") + rs.jcarrBranch = gadgets.NewOneLiner(rs.grid, "jcarr") + + rs.dirtyLabel = gadgets.NewOneLiner(rs.grid, "dirty") + + rs.speed = gadgets.NewOneLiner(rs.grid, "refresh speed =") + rs.speedActual = gadgets.NewOneLiner(rs.grid, "speed actual =") + + rs.grid.NewButton("update", func() { + rs.Update() + }) + rs.grid.NewButton("recommend", func() { + log.Warn("Is repo dirty?", rs.dirtyLabel.Get()) + log.Warn("list the known tags") + rs.populateTags() + log.Warn("Does master == devel? ") + log.Warn("Does devel == jcarr?") + log.Warn("Is repo pushed upstream? git.wit.org or github?") + }) + + rs.grid.Margin() + rs.grid.Pad() +} |
