From a385f4982f03e6c5799df2f6894aeb1912c9d5f2 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 30 Nov 2017 11:04:35 +0100 Subject: [PATCH] examples/tableview: Some more fiddling --- examples/tableview/tableview.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/tableview/tableview.go b/examples/tableview/tableview.go index b1f638a8..c45e8c1d 100644 --- a/examples/tableview/tableview.go +++ b/examples/tableview/tableview.go @@ -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() { @@ -221,7 +224,7 @@ func main() { } case 3: - if isNew { + if item.Quux.After(time.Now().Add(-365 * 24 * time.Hour)) { style.Font = boldFont } }