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:
commit
8c71604732
@ -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":
|
||||||
|
Loading…
Reference in New Issue
Block a user