Skip to content

Commit

Permalink
examples/tableview: Some more fiddling
Browse files Browse the repository at this point in the history
  • Loading branch information
lxn committed Nov 30, 2017
1 parent 3cfc4db commit a385f49
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/tableview/tableview.go
Expand Up @@ -190,10 +190,13 @@ func main() {
},
StyleCell: func(style *walk.CellStyle) {
item := model.items[style.Row()]
isNew := item.Quux.After(time.Now().Add(-365 * 24 * time.Hour))

if isNew {
style.BackgroundColor = walk.RGB(159, 215, 255)
if item.checked {
if style.Row()%2 == 0 {
style.BackgroundColor = walk.RGB(159, 215, 255)
} else {
style.BackgroundColor = walk.RGB(143, 199, 239)
}
}

switch style.Col() {
Expand Down Expand Up @@ -221,7 +224,7 @@ func main() {
}

case 3:
if isNew {
if item.Quux.After(time.Now().Add(-365 * 24 * time.Hour)) {
style.Font = boldFont
}
}
Expand Down

0 comments on commit a385f49

Please sign in to comment.