mirror of https://github.com/miguelmota/cointop
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.
26 lines
787 B
Go
26 lines
787 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 %sFavorites %sPortfolio %sSave", "[Q]", "[?]", "[Enter]", "[[ ]]", "[/]", "[C]", "[F]", "[P]", "[CTRL-S]")
|
|
str := pad.Right(fmt.Sprintf("%v %sPage %v/%v %s", base, "[← →]", currpage, totalpages, s), ct.maxtablewidth, " ")
|
|
v := fmt.Sprintf("v%s", ct.version())
|
|
str = str[:len(str)-len(v)+2] + v
|
|
fmt.Fprintln(ct.statusbarview, str)
|
|
})
|
|
}
|
|
|
|
func (ct *Cointop) refreshRowLink() {
|
|
url := ct.rowLinkShort()
|
|
ct.updateStatusbar(fmt.Sprintf("%sOpen %s", "[O]", url))
|
|
}
|