mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Row color as common function
This commit is contained in:
@@ -16,7 +16,7 @@ func (widget *Widget) display(clocks []Clock) {
|
||||
for idx, clock := range clocks {
|
||||
str = str + fmt.Sprintf(
|
||||
" [%s]%-12s %-10s %7s[white]\n",
|
||||
widget.rowColor(idx),
|
||||
wtf.RowColor("clocks", idx),
|
||||
clock.Label,
|
||||
clock.LocalTime.Format(wtf.SimpleTimeFormat),
|
||||
clock.LocalTime.Format(wtf.SimpleDateFormat),
|
||||
@@ -25,13 +25,3 @@ func (widget *Widget) display(clocks []Clock) {
|
||||
|
||||
fmt.Fprintf(widget.View, "%s", str)
|
||||
}
|
||||
|
||||
func (widget *Widget) rowColor(idx int) string {
|
||||
rowCol := Config.UString("wtf.mods.clocks.colors.row.even", "lightblue")
|
||||
|
||||
if idx%2 == 0 {
|
||||
rowCol = Config.UString("wtf.mods.clocks.colors.row.odd", "white")
|
||||
}
|
||||
|
||||
return rowCol
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user