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

23 lines
673 B
Go

package cointop
import (
"fmt"
"github.com/miguelmota/cointop/pkg/pad"
)
func (ct *Cointop) updateStatusbar(s string) {
ct.update(func() {
ct.statusbarview.Clear()
currpage := ct.currentDisplayPage()
totalpages := ct.totalPages()
base := fmt.Sprintf("%sQuit %sHelp %sChart %sRange %sSearch %sConvert %sFavorite %sSave", "[Q]", "[?]", "[Enter]", "[[ ]]", "[/]", "[C]", "[F]", "[CTRL-S]")
fmt.Fprintln(ct.statusbarview, pad.Right(fmt.Sprintf("%v %sPage %v/%v %s", base, "[← →]", currpage, totalpages, s), ct.maxtablewidth, " "))
})
}
func (ct *Cointop) refreshRowLink() {
url := ct.rowLink()
ct.updateStatusbar(fmt.Sprintf("%sOpen %s", "[O]", url))
}