2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-16 21:25:38 +00:00

Merge branch 'afh-rank-color'

This commit is contained in:
Miguel Mota 2021-04-24 16:58:42 -07:00
commit 8c71604732
No known key found for this signature in database
GPG Key ID: 67EC1161588A00F9

View File

@ -78,18 +78,20 @@ func (ct *Cointop) GetCoinsTable() *table.Table {
rightMargin := 1 rightMargin := 1
switch header { switch header {
case "rank": case "rank":
star := ct.colorscheme.TableRow(" ") star := " "
rankcolor := ct.colorscheme.TableRow
if coin.Favorite { if coin.Favorite {
star = ct.colorscheme.TableRowFavorite("*") star = "*"
rankcolor = ct.colorscheme.TableRowFavorite
} }
rank := fmt.Sprintf("%s%v", star, ct.colorscheme.TableRow(fmt.Sprintf("%6v ", coin.Rank))) rank := fmt.Sprintf("%s%6v ", star, coin.Rank)
ct.SetTableColumnWidth(header, 8) ct.SetTableColumnWidth(header, 8)
ct.SetTableColumnAlignLeft(header, false) ct.SetTableColumnAlignLeft(header, false)
rowCells = append(rowCells, &table.RowCell{ rowCells = append(rowCells, &table.RowCell{
LeftMargin: leftMargin, LeftMargin: leftMargin,
RightMargin: rightMargin, RightMargin: rightMargin,
LeftAlign: false, LeftAlign: false,
Color: ct.colorscheme.Default, Color: rankcolor,
Text: rank, Text: rank,
}) })
case "name": case "name":