|
@@ -14,7 +14,7 @@ import (
|
|
"github.com/hypebeast/go-osc/osc"
|
|
"github.com/hypebeast/go-osc/osc"
|
|
)
|
|
)
|
|
|
|
|
|
-// Your basic bar object
|
|
|
|
|
|
+// Your basic screenbar
|
|
type ScreenBar struct {
|
|
type ScreenBar struct {
|
|
title string
|
|
title string
|
|
ticks int
|
|
ticks int
|
|
@@ -29,13 +29,14 @@ func (bar *ScreenBar) tick() {
|
|
bar.update()
|
|
bar.update()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// Ticker's gonna need to be reset sometimes
|
|
func (bar *ScreenBar) reset(msg *osc.Message) {
|
|
func (bar *ScreenBar) reset(msg *osc.Message) {
|
|
bar.ticks = 0
|
|
bar.ticks = 0
|
|
bar.ticker.Reset(time.Second)
|
|
bar.ticker.Reset(time.Second)
|
|
bar.update()
|
|
bar.update()
|
|
}
|
|
}
|
|
|
|
|
|
-// Paint a screen by drawing bar
|
|
|
|
|
|
+// (Re)paint a screen by drawing bar
|
|
func (bar *ScreenBar) update() {
|
|
func (bar *ScreenBar) update() {
|
|
// Config size if in terminal
|
|
// Config size if in terminal
|
|
if term.IsTerminal(0) {
|
|
if term.IsTerminal(0) {
|