gui testing and cleanups
This commit is contained in:
parent
d9c4d18b16
commit
6cee7c5420
2
doGui.go
2
doGui.go
|
@ -31,7 +31,7 @@ func doGui() {
|
|||
|
||||
me.patchWin = new(patchesWindow)
|
||||
|
||||
me.mainWindow = gadgets.RawBasicWindow("Forge: (this doesn't work yet)")
|
||||
me.mainWindow = gadgets.RawBasicWindow("Forge: (this kinda works sometimes)")
|
||||
me.mainWindow.Make()
|
||||
me.mainWindow.Show()
|
||||
me.mainWindow.Custom = func() {
|
||||
|
|
|
@ -111,12 +111,21 @@ func globalBuildOptions(vbox *gui.Node) {
|
|||
me.autoCreateBranches = grid.NewCheckbox("create if missing").SetChecked(true)
|
||||
grid.NextRow()
|
||||
|
||||
grid.NewButton("Show Repos", func() {
|
||||
if me.repos.Hidden() {
|
||||
me.repos.Show()
|
||||
} else {
|
||||
me.repos.Hide()
|
||||
}
|
||||
})
|
||||
grid.NewButton("patches window", func() {
|
||||
me.patchWin.once.Do(me.patchWin.initWindow)
|
||||
me.patchWin.Toggle()
|
||||
})
|
||||
grid.NewButton("update patch summary", func() {
|
||||
me.summary.Update()
|
||||
})
|
||||
grid.NewButton("test add", func() {
|
||||
me.patchWin.initGroup()
|
||||
})
|
||||
grid.NewButton("hide patches window", func() {
|
||||
me.patchWin.Hide()
|
||||
})
|
||||
}
|
||||
|
|
19
windowNew.go
19
windowNew.go
|
@ -13,10 +13,10 @@ import (
|
|||
type patchesWindow struct {
|
||||
once sync.Once
|
||||
win *gadgets.BasicWindow
|
||||
box *gui.Node
|
||||
stackBox *gui.Node
|
||||
|
||||
// the top box of the repolist window
|
||||
topbox *gui.Node
|
||||
shelf *gui.Node
|
||||
}
|
||||
|
||||
func (r *patchesWindow) Hidden() bool {
|
||||
|
@ -27,7 +27,7 @@ func (r *patchesWindow) Toggle() {
|
|||
if r.Hidden() {
|
||||
r.Show()
|
||||
} else {
|
||||
r.Show()
|
||||
r.Hide()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,11 +40,11 @@ func (r *patchesWindow) Hide() {
|
|||
}
|
||||
|
||||
func (r *patchesWindow) Disable() {
|
||||
r.box.Disable()
|
||||
r.stackBox.Disable()
|
||||
}
|
||||
|
||||
func (r *patchesWindow) Enable() {
|
||||
r.box.Enable()
|
||||
r.stackBox.Enable()
|
||||
}
|
||||
|
||||
// you can only have one of these
|
||||
|
@ -53,18 +53,21 @@ func (r *patchesWindow) initWindow() {
|
|||
r.win = gadgets.RawBasicWindow("All git repositories in ~/go/src/")
|
||||
r.win.Make()
|
||||
|
||||
r.box = r.win.Box().NewBox("bw vbox", false)
|
||||
r.stackBox = r.win.Box().NewBox("bw vbox", false)
|
||||
// me.reposwin.Draw()
|
||||
r.win.Custom = func() {
|
||||
log.Warn("Repo Window close. Do something here?")
|
||||
// sets the hidden flag to false so Toggle() works
|
||||
r.win.Hide()
|
||||
}
|
||||
|
||||
r.topbox = r.initGroup()
|
||||
r.shelf = r.initGroup()
|
||||
submitPatchesBox(r.shelf)
|
||||
}
|
||||
|
||||
func (r *patchesWindow) initGroup() *gui.Node {
|
||||
// reposbox.SetExpand(false)
|
||||
group1 := r.box.NewGroup("Filter:")
|
||||
group1 := r.stackBox.NewGroup("Filter:")
|
||||
|
||||
hbox := group1.Box()
|
||||
// hbox.Horizontal()
|
||||
|
|
|
@ -116,20 +116,10 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
|||
applyPatchset(pset)
|
||||
})
|
||||
|
||||
s.grid.NewButton("Show Repos", func() {
|
||||
s.Update()
|
||||
if me.repos.Hidden() {
|
||||
me.repos.Show()
|
||||
} else {
|
||||
me.repos.Hide()
|
||||
}
|
||||
})
|
||||
|
||||
// disable these until there are not dirty repos
|
||||
// s.reason.Disable()
|
||||
s.submitB.Disable()
|
||||
s.grid.NextRow()
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,9 @@ func makeRepoView() *repoWindow {
|
|||
r.box = r.win.Box().NewBox("bw vbox", false)
|
||||
// me.reposwin.Draw()
|
||||
r.win.Custom = func() {
|
||||
log.Warn("Repo Window close. Do something here?")
|
||||
log.Warn("Repo Window close. hidden=true")
|
||||
// sets the hidden flag to false so Toggle() works
|
||||
r.win.Hide()
|
||||
}
|
||||
|
||||
r.topbox = r.repoMenu()
|
||||
|
|
Loading…
Reference in New Issue