summaryrefslogtreecommitdiff
path: root/draw.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-23 11:12:58 -0600
committerJeff Carr <[email protected]>2024-01-23 11:12:58 -0600
commit2f4cba36dddaf1b0cfeabb875527b03bdb75036b (patch)
treecc432f248812d43881a20de6841150b1be50b349 /draw.go
parent294119e7c2678b609aa8b66b6ffc219f1c399309 (diff)
allow user to switch branches
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'draw.go')
-rw-r--r--draw.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/draw.go b/draw.go
index dc2a9c1..e9c52f7 100644
--- a/draw.go
+++ b/draw.go
@@ -36,8 +36,23 @@ func (rs *RepoStatus) drawGitBranches() {
newgrid := rs.gitBranchesGroup.NewGrid("gridnuts", 2, 2)
rs.masterDrop = gadgets.NewBasicDropdown(newgrid, "main branch")
+ rs.masterDrop.Custom = func () {
+ log.Log(WARN, "Switching main branch to:", rs.masterDrop.String())
+ rs.masterBranchVersion.SetLabel(rs.masterDrop.String())
+ rs.mainWorkingName.SetValue(rs.masterDrop.String())
+ }
rs.develDrop = gadgets.NewBasicDropdown(newgrid, "devel branch")
+ rs.develDrop.Custom = func () {
+ log.Log(WARN, "Switching devel branch to:", rs.develDrop.String())
+ rs.develBranchVersion.SetLabel(rs.develDrop.String())
+ rs.develWorkingName.SetValue(rs.develDrop.String())
+ }
rs.userDrop = gadgets.NewBasicDropdown(newgrid, "user branch")
+ rs.userDrop.Custom = func () {
+ log.Log(WARN, "Switching user branch to:", rs.userDrop.String())
+ rs.userBranchVersion.SetLabel(rs.userDrop.String())
+ rs.userWorkingName.SetValue(rs.userDrop.String())
+ }
rs.lasttag = gadgets.NewOneLiner(newgrid, "last tag")