You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cointop/cointop/statusbar.go

25 lines
536 B
Go

package cointop
import (
"fmt"
"github.com/miguelmota/cointop/pkg/pad"
)
func (ct *Cointop) updateStatusbar(s string) {
maxX := ct.Width()
ct.Update(func() {
ct.statusbarview.Clear()
currpage := ct.getCurrentPage()
totalpages := ct.getTotalPages()
fmt.Fprintln(ct.statusbarview, pad.Right(fmt.Sprintf("[q]uit [h]elp [← →]page %v/%v %s", currpage, totalpages, s), maxX, " "))
})
}
func (ct *Cointop) refreshRowLink() {
url := ct.rowLink()
ct.Update(func() {
ct.updateStatusbar(fmt.Sprintf("[↵]%s", url))
})
}