2
0
mirror of https://github.com/edouardparis/lntop synced 2024-11-04 06:00:14 +00:00
lntop/ui/views/footer.go

35 lines
560 B
Go
Raw Normal View History

2019-03-26 21:46:17 +00:00
package views
2019-04-02 08:14:39 +00:00
import (
"fmt"
"github.com/jroimartin/gocui"
"github.com/edouardparis/lntop/ui/color"
)
2019-03-26 21:46:17 +00:00
const (
FOOTER = "footer"
)
type Footer struct{}
func (f *Footer) Set(g *gocui.Gui, x0, y0, x1, y1 int) error {
2019-04-02 08:21:12 +00:00
v, err := g.SetView(FOOTER, x0-1, y0, x1, y1)
2019-03-26 21:46:17 +00:00
if err != nil {
if err != gocui.ErrUnknownView {
return err
}
}
v.Frame = false
v.BgColor = gocui.ColorCyan
2019-04-02 08:14:39 +00:00
v.FgColor = gocui.ColorBlack
v.Clear()
fmt.Fprintln(v, fmt.Sprintf("%s%s", color.BlackBg("F1"), "Help"))
2019-03-26 21:46:17 +00:00
return nil
}
func NewFooter() *Footer {
return &Footer{}
}