bombadillo/footbar.go

47 lines
1006 B
Go
Raw Normal View History

package main
import (
"fmt"
)
//------------------------------------------------\\
// + + + T Y P E S + + + \\
//--------------------------------------------------\\
type Footbar struct {
2019-09-12 05:53:36 +00:00
PercentRead int
PageType string
}
//------------------------------------------------\\
// + + + R E C E I V E R S + + + \\
//--------------------------------------------------\\
func (f *Footbar) SetPercentRead(p int) {
2019-09-12 05:53:36 +00:00
f.PercentRead = p
}
func (f *Footbar) SetPageType(t string) {
f.PageType = t
}
func (f *Footbar) Draw() {
// TODO this will actually draw the bar
// without having to redraw everything else
}
2019-09-12 05:53:36 +00:00
func (f *Footbar) Render(termWidth int) string {
return fmt.Sprintf("\033[7m%-*.*s\033[0m", termWidth, termWidth, "")
}
//------------------------------------------------\\
// + + + F U N C T I O N S + + + \\
//--------------------------------------------------\\
func MakeFootbar() Footbar {
2019-09-12 05:53:36 +00:00
return Footbar{100, "N/A"}
}