shows state and dims the buttons

This commit is contained in:
Jeff Carr 2025-01-30 19:05:21 -06:00
parent 282215e760
commit bc15bd663e
1 changed files with 9 additions and 2 deletions

View File

@ -154,10 +154,14 @@ func (r *patchesWindow) addPatchsetNew(pset *forgepb.Patchset) {
r.psetgrid.NewLabel(pset.Name)
r.psetgrid.NewLabel(pset.Comment)
r.psetgrid.NewLabel(pset.GitAuthorName)
r.psetgrid.NewLabel(pset.State)
if pset.State == "BROKEN" {
r.psetgrid.NewLabel("Bad")
} else {
r.psetgrid.NewLabel("Good")
}
var win *patchWindow
r.psetgrid.NewButton("View", func() {
b := r.psetgrid.NewButton("View", func() {
// has the window already been created?
if win != nil {
win.Toggle()
@ -167,6 +171,9 @@ func (r *patchesWindow) addPatchsetNew(pset *forgepb.Patchset) {
win = makePatchWindow(pset)
win.Show()
})
if pset.State == "BROKEN" {
b.Disable()
}
r.psetgrid.NextRow()
}